eggplant.market.models package

Submodules

eggplant.market.models.cart module

class eggplant.market.models.cart.Basket(id, user, created, status)[source]

Bases: django.db.models.base.Model

CHECKEDOUT = 'checked-out'
exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

OPEN = 'open'
STATUES = (('open', 'open'), ('checked-out', 'checked-out'))
add_to_items(product=None, quantity=1, delivery_date=None)[source]
created

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

do_checkout(*args, **kwargs)[source]
get_items_count()[source]
get_next_by_created(*moreargs, **morekwargs)
get_previous_by_created(*moreargs, **morekwargs)
get_status_display(*moreargs, **morekwargs)
get_total_amount()[source]
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

items

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

objects = <eggplant.market.models.cart.BasketManager object>
remove_from_items(product=None, quantity=1, delivery_date=None)[source]
status

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

user

Accessor to the related object on the forward side of a many-to-one or one-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

child.parent is a ForwardManyToOneDescriptor instance.

user_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class eggplant.market.models.cart.BasketItem(id, basket, product, quantity, delivery_date)[source]

Bases: django.db.models.base.Model

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

basket

Accessor to the related object on the forward side of a many-to-one or one-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

child.parent is a ForwardManyToOneDescriptor instance.

basket_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

delivery_date

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <django.db.models.manager.Manager object>
product

Accessor to the related object on the forward side of a many-to-one or one-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

child.parent is a ForwardManyToOneDescriptor instance.

product_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

quantity

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class eggplant.market.models.cart.BasketManager[source]

Bases: django.db.models.manager.Manager

open_for_user(user)[source]

Get open basket for a given user. This is just a wrapper around get_or_create so we can add more default kwargs or logic to basket in one place - perhaps a check if user payed some fees(?)...

eggplant.market.models.inventory module

class eggplant.market.models.inventory.Product(id, title, description, category, price_currency, price, stock, tax, enabled, image)[source]

Bases: django.db.models.base.Model

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

basketitem_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

category

Accessor to the related object on the forward side of a many-to-one or one-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

child.parent is a ForwardManyToOneDescriptor instance.

category_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

description

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

enabled

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

get_price_currency_display(*moreargs, **morekwargs)
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

image

Just like the FileDescriptor, but for ImageFields. The only difference is assigning the width/height to the width_field/height_field, if appropriate.

objects = <djmoney.models.managers.MoneyManager object>
price
price_currency

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

stock

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

tax

Accessor to the related object on the forward side of a many-to-one or one-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

child.parent is a ForwardManyToOneDescriptor instance.

tax_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

title

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class eggplant.market.models.inventory.ProductCategory(id, title, description, enabled)[source]

Bases: django.db.models.base.Model

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

description

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

enabled

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <django.db.models.manager.Manager object>
product_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

title

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class eggplant.market.models.inventory.ProductTax(id, title, description, enabled, tax)[source]

Bases: django.db.models.base.Model

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

description

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

enabled

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <django.db.models.manager.Manager object>
product_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

tax

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

title

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

eggplant.market.models.inventory.do_upload_product_image(inst, filename)[source]

eggplant.market.models.listeners module

Notice: getpaid calls it “order” objects, however since our payments app does not model orders, we also call this “payment” in eggplant.payments.models

eggplant.market.models.listeners.new_payment_listener(sender, order=None, payment=None, **kwargs)[source]

Log how many and which payments were made.

eggplant.market.models.listeners.new_payment_query_listener(sender, order=None, payment=None, **kwargs)[source]

Fills in required payment details.

eggplant.market.models.listeners.order_additional_validation_listener(sender, request=None, order=None, backend=None, **kwargs)[source]

Custom validation.

eggplant.market.models.listeners.payment_status_changed_listener(sender, instance, old_status, new_status, **kwargs)[source]

Here we will actually do something, when payment is accepted. E.g. lets change an order status based on payment status.

eggplant.market.models.listeners.user_data_query_listener(sender, order=None, user_data=None, **kwargs)[source]

Fills in required user details.

eggplant.market.models.payment module

class eggplant.market.models.payment.Payment(id, amount_currency, account, amount, created)[source]

Bases: django.db.models.base.Model

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

account

Accessor to the related object on the forward side of a many-to-one or one-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

child.parent is a ForwardManyToOneDescriptor instance.

account_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

amount
amount_currency

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

created

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

get_absolute_url()[source]
get_amount_currency_display(*moreargs, **morekwargs)
get_last_payment_status()[source]
get_next_by_created(*moreargs, **morekwargs)
get_previous_by_created(*moreargs, **morekwargs)
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

is_ready_for_payment()[source]
objects = <djmoney.models.managers.MoneyManager object>
payments

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

Module contents