shuup.campaigns.models package¶
Submodules¶
shuup.campaigns.models.basket_conditions module¶
-
class
shuup.campaigns.models.basket_conditions.
BasketCondition
(id, polymorphic_ctype, active)[source]¶ Bases:
polymorphic.models.PolymorphicModel
Parameters: - id (AutoField) – Id
- polymorphic_ctype (ForeignKey to
django.contrib.contenttypes.models.ContentType
) – Polymorphic ctype - active (BooleanField) – Active
-
baskettotalproductamountcondition_set
¶ OneToOneRel to
shuup.campaigns.models.basket_conditions.BasketTotalProductAmountCondition
-
baskettotalamountcondition_set
¶ OneToOneRel to
shuup.campaigns.models.basket_conditions.BasketTotalAmountCondition
-
baskettotalundiscountedproductamountcondition_set
¶ OneToOneRel to
shuup.campaigns.models.basket_conditions.BasketTotalUndiscountedProductAmountCondition
-
basketmaxtotalproductamountcondition_set
¶ OneToOneRel to
shuup.campaigns.models.basket_conditions.BasketMaxTotalProductAmountCondition
-
basketmaxtotalamountcondition_set
¶ OneToOneRel to
shuup.campaigns.models.basket_conditions.BasketMaxTotalAmountCondition
-
productsinbasketcondition_set
¶ OneToOneRel to
shuup.campaigns.models.basket_conditions.ProductsInBasketCondition
-
contactgroupbasketcondition_set
¶ OneToOneRel to
shuup.campaigns.models.basket_conditions.ContactGroupBasketCondition
-
contactbasketcondition_set
¶ OneToOneRel to
shuup.campaigns.models.basket_conditions.ContactBasketCondition
-
categoryproductsbasketcondition_set
¶ OneToOneRel to
shuup.campaigns.models.basket_conditions.CategoryProductsBasketCondition
-
hourbasketcondition_set
¶ OneToOneRel to
shuup.campaigns.models.basket_conditions.HourBasketCondition
-
childrenproductcondition_set
¶ OneToOneRel to
shuup.campaigns.models.basket_conditions.ChildrenProductCondition
Replace Django’s inheritance accessor member functions for our model (self.__class__) with our own versions. We monkey patch them until a patch can be added to Django (which would probably be very small and make all of this obsolete).
If we have inheritance of the form ModelA -> ModelB ->ModelC then Django creates accessors like this: - ModelA: modelb - ModelB: modela_ptr, modelb, modelc - ModelC: modela_ptr, modelb, modelb_ptr, modelc
These accessors allow Django (and everyone else) to travel up and down the inheritance tree for the db object at hand.
The original Django accessors use our polymorphic manager. But they should not. So we replace them with our own accessors that use our appropriate base_objects manager.
Parameters: - id (AutoField) – Id
- polymorphic_ctype (ForeignKey to
django.contrib.contenttypes.models.ContentType
) – Polymorphic ctype - active (BooleanField) – Active
-
baskettotalproductamountcondition_set
OneToOneRel to
shuup.campaigns.models.basket_conditions.BasketTotalProductAmountCondition
-
baskettotalamountcondition_set
OneToOneRel to
shuup.campaigns.models.basket_conditions.BasketTotalAmountCondition
-
baskettotalundiscountedproductamountcondition_set
OneToOneRel to
shuup.campaigns.models.basket_conditions.BasketTotalUndiscountedProductAmountCondition
-
basketmaxtotalproductamountcondition_set
OneToOneRel to
shuup.campaigns.models.basket_conditions.BasketMaxTotalProductAmountCondition
-
basketmaxtotalamountcondition_set
OneToOneRel to
shuup.campaigns.models.basket_conditions.BasketMaxTotalAmountCondition
-
productsinbasketcondition_set
OneToOneRel to
shuup.campaigns.models.basket_conditions.ProductsInBasketCondition
-
contactgroupbasketcondition_set
OneToOneRel to
shuup.campaigns.models.basket_conditions.ContactGroupBasketCondition
-
contactbasketcondition_set
OneToOneRel to
shuup.campaigns.models.basket_conditions.ContactBasketCondition
-
categoryproductsbasketcondition_set
OneToOneRel to
shuup.campaigns.models.basket_conditions.CategoryProductsBasketCondition
-
hourbasketcondition_set
OneToOneRel to
shuup.campaigns.models.basket_conditions.HourBasketCondition
-
childrenproductcondition_set
OneToOneRel to
shuup.campaigns.models.basket_conditions.ChildrenProductCondition
-
model
= None¶
-
active
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
name
= 'Basket condition'¶
-
exception
DoesNotExist
¶ Bases:
django.core.exceptions.ObjectDoesNotExist
-
exception
MultipleObjectsReturned
¶ Bases:
django.core.exceptions.MultipleObjectsReturned
-
basketmaxtotalamountcondition
¶ Accessor to the related object on the reverse side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Place.restaurant
is aReverseOneToOneDescriptor
instance.
-
basketmaxtotalproductamountcondition
¶ Accessor to the related object on the reverse side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Place.restaurant
is aReverseOneToOneDescriptor
instance.
-
baskettotalamountcondition
¶ Accessor to the related object on the reverse side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Place.restaurant
is aReverseOneToOneDescriptor
instance.
-
baskettotalproductamountcondition
¶ Accessor to the related object on the reverse side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Place.restaurant
is aReverseOneToOneDescriptor
instance.
-
baskettotalundiscountedproductamountcondition
¶ Accessor to the related object on the reverse side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Place.restaurant
is aReverseOneToOneDescriptor
instance.
-
campaign
¶ Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.
In the example:
class Pizza(Model): toppings = ManyToManyField(Topping, related_name='pizzas')
Pizza.toppings
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
-
categoryproductsbasketcondition
¶ Accessor to the related object on the reverse side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Place.restaurant
is aReverseOneToOneDescriptor
instance.
-
childrenproductcondition
¶ Accessor to the related object on the reverse side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Place.restaurant
is aReverseOneToOneDescriptor
instance.
-
contactbasketcondition
¶ Accessor to the related object on the reverse side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Place.restaurant
is aReverseOneToOneDescriptor
instance.
-
contactgroupbasketcondition
¶ Accessor to the related object on the reverse side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Place.restaurant
is aReverseOneToOneDescriptor
instance.
-
hourbasketcondition
¶ Accessor to the related object on the reverse side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Place.restaurant
is aReverseOneToOneDescriptor
instance.
-
id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
polymorphic_ctype
¶ Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
-
polymorphic_primary_key_name
= 'id'¶
-
polymorphic_super_sub_accessors_replaced
= False¶
-
productsinbasketcondition
¶ Accessor to the related object on the reverse side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Place.restaurant
is aReverseOneToOneDescriptor
instance.
-
class
shuup.campaigns.models.basket_conditions.
BasketTotalProductAmountCondition
(id, polymorphic_ctype, active, basketcondition_ptr, product_count)[source]¶ Bases:
shuup.campaigns.models.basket_conditions.BasketCondition
Parameters: - id (AutoField) – Id
- polymorphic_ctype (ForeignKey to
django.contrib.contenttypes.models.ContentType
) – Polymorphic ctype - active (BooleanField) – Active
- basketcondition_ptr (OneToOneField to
shuup.campaigns.models.basket_conditions.BasketCondition
) – Basketcondition ptr - product_count (DecimalField) – Product count in basket
Replace Django’s inheritance accessor member functions for our model (self.__class__) with our own versions. We monkey patch them until a patch can be added to Django (which would probably be very small and make all of this obsolete).
If we have inheritance of the form ModelA -> ModelB ->ModelC then Django creates accessors like this: - ModelA: modelb - ModelB: modela_ptr, modelb, modelc - ModelC: modela_ptr, modelb, modelb_ptr, modelc
These accessors allow Django (and everyone else) to travel up and down the inheritance tree for the db object at hand.
The original Django accessors use our polymorphic manager. But they should not. So we replace them with our own accessors that use our appropriate base_objects manager.
Parameters: - id (AutoField) – Id
- polymorphic_ctype (ForeignKey to
django.contrib.contenttypes.models.ContentType
) – Polymorphic ctype - active (BooleanField) – Active
- basketcondition_ptr (OneToOneField to
shuup.campaigns.models.basket_conditions.BasketCondition
) – Basketcondition ptr - product_count (DecimalField) – Product count in basket
-
identifier
= 'basket_product_condition'¶
-
name
= 'Basket product count'¶
-
product_count
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
description
¶
-
value
¶
-
exception
DoesNotExist
¶ Bases:
shuup.campaigns.models.basket_conditions.DoesNotExist
-
exception
MultipleObjectsReturned
¶ Bases:
shuup.campaigns.models.basket_conditions.MultipleObjectsReturned
-
basketcondition_ptr
¶ Accessor to the related object on the forward side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Restaurant.place
is aForwardOneToOneDescriptor
instance.
-
basketcondition_ptr_id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
polymorphic_primary_key_name
= 'id'¶
-
polymorphic_super_sub_accessors_replaced
= False¶
-
class
shuup.campaigns.models.basket_conditions.
BasketTotalAmountCondition
(id, polymorphic_ctype, active, basketcondition_ptr, amount_value)[source]¶ Bases:
shuup.utils.properties.MoneyPropped
,shuup.campaigns.models.basket_conditions.BasketCondition
Parameters: - id (AutoField) – Id
- polymorphic_ctype (ForeignKey to
django.contrib.contenttypes.models.ContentType
) – Polymorphic ctype - active (BooleanField) – Active
- basketcondition_ptr (OneToOneField to
shuup.campaigns.models.basket_conditions.BasketCondition
) – Basketcondition ptr - amount_value (MoneyValueField) – Basket total amount
-
identifier
= 'basket_amount_condition'¶
-
name
= 'Basket total value'¶
-
amount
¶ Property for Price object.
Similar to
MoneyProperty
, but also hasincludes_tax
field.Operaters with
TaxfulPrice
andTaxlessPrice
objects.
-
amount_value
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
description
¶
-
value
¶
-
exception
DoesNotExist
¶ Bases:
shuup.campaigns.models.basket_conditions.DoesNotExist
-
exception
MultipleObjectsReturned
¶ Bases:
shuup.campaigns.models.basket_conditions.MultipleObjectsReturned
-
basketcondition_ptr
¶ Accessor to the related object on the forward side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Restaurant.place
is aForwardOneToOneDescriptor
instance.
-
basketcondition_ptr_id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
polymorphic_primary_key_name
= 'id'¶
-
polymorphic_super_sub_accessors_replaced
= False¶
-
class
shuup.campaigns.models.basket_conditions.
BasketTotalUndiscountedProductAmountCondition
(id, polymorphic_ctype, active, basketcondition_ptr, amount_value)[source]¶ Bases:
shuup.utils.properties.MoneyPropped
,shuup.campaigns.models.basket_conditions.BasketCondition
Parameters: - id (AutoField) – Id
- polymorphic_ctype (ForeignKey to
django.contrib.contenttypes.models.ContentType
) – Polymorphic ctype - active (BooleanField) – Active
- basketcondition_ptr (OneToOneField to
shuup.campaigns.models.basket_conditions.BasketCondition
) – Basketcondition ptr - amount_value (MoneyValueField) – Basket total amount
-
identifier
= 'basket_amount_condition_undiscounted'¶
-
name
= 'Undiscounted basket total value'¶
-
amount
¶ Property for Price object.
Similar to
MoneyProperty
, but also hasincludes_tax
field.Operaters with
TaxfulPrice
andTaxlessPrice
objects.
-
amount_value
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
description
¶
-
value
¶
-
exception
DoesNotExist
¶ Bases:
shuup.campaigns.models.basket_conditions.DoesNotExist
-
exception
MultipleObjectsReturned
¶ Bases:
shuup.campaigns.models.basket_conditions.MultipleObjectsReturned
-
basketcondition_ptr
¶ Accessor to the related object on the forward side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Restaurant.place
is aForwardOneToOneDescriptor
instance.
-
basketcondition_ptr_id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
polymorphic_primary_key_name
= 'id'¶
-
polymorphic_super_sub_accessors_replaced
= False¶
-
class
shuup.campaigns.models.basket_conditions.
BasketMaxTotalProductAmountCondition
(id, polymorphic_ctype, active, basketcondition_ptr, product_count)[source]¶ Bases:
shuup.campaigns.models.basket_conditions.BasketCondition
Parameters: - id (AutoField) – Id
- polymorphic_ctype (ForeignKey to
django.contrib.contenttypes.models.ContentType
) – Polymorphic ctype - active (BooleanField) – Active
- basketcondition_ptr (OneToOneField to
shuup.campaigns.models.basket_conditions.BasketCondition
) – Basketcondition ptr - product_count (DecimalField) – Maximum product count in basket
Replace Django’s inheritance accessor member functions for our model (self.__class__) with our own versions. We monkey patch them until a patch can be added to Django (which would probably be very small and make all of this obsolete).
If we have inheritance of the form ModelA -> ModelB ->ModelC then Django creates accessors like this: - ModelA: modelb - ModelB: modela_ptr, modelb, modelc - ModelC: modela_ptr, modelb, modelb_ptr, modelc
These accessors allow Django (and everyone else) to travel up and down the inheritance tree for the db object at hand.
The original Django accessors use our polymorphic manager. But they should not. So we replace them with our own accessors that use our appropriate base_objects manager.
Parameters: - id (AutoField) – Id
- polymorphic_ctype (ForeignKey to
django.contrib.contenttypes.models.ContentType
) – Polymorphic ctype - active (BooleanField) – Active
- basketcondition_ptr (OneToOneField to
shuup.campaigns.models.basket_conditions.BasketCondition
) – Basketcondition ptr - product_count (DecimalField) – Maximum product count in basket
-
identifier
= 'basket_max_product_condition'¶
-
name
= 'Basket maximum product count'¶
-
product_count
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
description
¶
-
value
¶
-
exception
DoesNotExist
¶ Bases:
shuup.campaigns.models.basket_conditions.DoesNotExist
-
exception
MultipleObjectsReturned
¶ Bases:
shuup.campaigns.models.basket_conditions.MultipleObjectsReturned
-
basketcondition_ptr
¶ Accessor to the related object on the forward side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Restaurant.place
is aForwardOneToOneDescriptor
instance.
-
basketcondition_ptr_id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
polymorphic_primary_key_name
= 'id'¶
-
polymorphic_super_sub_accessors_replaced
= False¶
-
class
shuup.campaigns.models.basket_conditions.
BasketMaxTotalAmountCondition
(id, polymorphic_ctype, active, basketcondition_ptr, amount_value)[source]¶ Bases:
shuup.utils.properties.MoneyPropped
,shuup.campaigns.models.basket_conditions.BasketCondition
Parameters: - id (AutoField) – Id
- polymorphic_ctype (ForeignKey to
django.contrib.contenttypes.models.ContentType
) – Polymorphic ctype - active (BooleanField) – Active
- basketcondition_ptr (OneToOneField to
shuup.campaigns.models.basket_conditions.BasketCondition
) – Basketcondition ptr - amount_value (MoneyValueField) – Maximum basket total amount
-
identifier
= 'basket_max_amount_condition'¶
-
name
= 'Basket maximum total value'¶
-
amount
¶ Property for Price object.
Similar to
MoneyProperty
, but also hasincludes_tax
field.Operaters with
TaxfulPrice
andTaxlessPrice
objects.
-
amount_value
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
description
¶
-
value
¶
-
exception
DoesNotExist
¶ Bases:
shuup.campaigns.models.basket_conditions.DoesNotExist
-
exception
MultipleObjectsReturned
¶ Bases:
shuup.campaigns.models.basket_conditions.MultipleObjectsReturned
-
basketcondition_ptr
¶ Accessor to the related object on the forward side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Restaurant.place
is aForwardOneToOneDescriptor
instance.
-
basketcondition_ptr_id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
polymorphic_primary_key_name
= 'id'¶
-
polymorphic_super_sub_accessors_replaced
= False¶
-
class
shuup.campaigns.models.basket_conditions.
ComparisonOperator
[source]¶ Bases:
enumfields.enums.Enum
An enumeration.
-
EQUALS
= 0¶
-
GTE
= 1¶
-
-
class
shuup.campaigns.models.basket_conditions.
ProductsInBasketCondition
(id, polymorphic_ctype, active, basketcondition_ptr, operator, quantity)[source]¶ Bases:
shuup.campaigns.models.basket_conditions.BasketCondition
Parameters: - id (AutoField) – Id
- polymorphic_ctype (ForeignKey to
django.contrib.contenttypes.models.ContentType
) – Polymorphic ctype - active (BooleanField) – Active
- basketcondition_ptr (OneToOneField to
shuup.campaigns.models.basket_conditions.BasketCondition
) – Basketcondition ptr - operator (EnumIntegerField) – Operator
- quantity (PositiveIntegerField) – Quantity
- products (ManyToManyField to
shuup.core.models.Product
) – Products
Replace Django’s inheritance accessor member functions for our model (self.__class__) with our own versions. We monkey patch them until a patch can be added to Django (which would probably be very small and make all of this obsolete).
If we have inheritance of the form ModelA -> ModelB ->ModelC then Django creates accessors like this: - ModelA: modelb - ModelB: modela_ptr, modelb, modelc - ModelC: modela_ptr, modelb, modelb_ptr, modelc
These accessors allow Django (and everyone else) to travel up and down the inheritance tree for the db object at hand.
The original Django accessors use our polymorphic manager. But they should not. So we replace them with our own accessors that use our appropriate base_objects manager.
Parameters: - id (AutoField) – Id
- polymorphic_ctype (ForeignKey to
django.contrib.contenttypes.models.ContentType
) – Polymorphic ctype - active (BooleanField) – Active
- basketcondition_ptr (OneToOneField to
shuup.campaigns.models.basket_conditions.BasketCondition
) – Basketcondition ptr - operator (EnumIntegerField) – Operator
- quantity (PositiveIntegerField) – Quantity
- products (ManyToManyField to
shuup.core.models.Product
) – Products
-
identifier
= 'basket_products_condition'¶
-
name
= 'Products in basket'¶
-
model
¶ alias of
Product
-
operator
¶ A property descriptor which ensures that
field.to_python()
is called on _every_ assignment to the field.This used to be provided by the
django.db.models.subclassing.Creator
class, which in turn was used by the deprecated-in-Django-1.10SubfieldBase
class, hence the reimplementation here.
-
quantity
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
products
¶ Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.
In the example:
class Pizza(Model): toppings = ManyToManyField(Topping, related_name='pizzas')
Pizza.toppings
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
-
description
¶
-
values
¶
-
exception
DoesNotExist
¶ Bases:
shuup.campaigns.models.basket_conditions.DoesNotExist
-
exception
MultipleObjectsReturned
¶ Bases:
shuup.campaigns.models.basket_conditions.MultipleObjectsReturned
-
basketcondition_ptr
¶ Accessor to the related object on the forward side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Restaurant.place
is aForwardOneToOneDescriptor
instance.
-
basketcondition_ptr_id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
get_operator_display
(*, field=<enumfields.fields.EnumIntegerField: operator>)¶
-
polymorphic_primary_key_name
= 'id'¶
-
polymorphic_super_sub_accessors_replaced
= False¶
-
class
shuup.campaigns.models.basket_conditions.
ContactGroupBasketCondition
(id, polymorphic_ctype, active, basketcondition_ptr)[source]¶ Bases:
shuup.campaigns.models.basket_conditions.BasketCondition
Parameters: - id (AutoField) – Id
- polymorphic_ctype (ForeignKey to
django.contrib.contenttypes.models.ContentType
) – Polymorphic ctype - active (BooleanField) – Active
- basketcondition_ptr (OneToOneField to
shuup.campaigns.models.basket_conditions.BasketCondition
) – Basketcondition ptr - contact_groups (ManyToManyField to
shuup.core.models.ContactGroup
) – Contact groups
Replace Django’s inheritance accessor member functions for our model (self.__class__) with our own versions. We monkey patch them until a patch can be added to Django (which would probably be very small and make all of this obsolete).
If we have inheritance of the form ModelA -> ModelB ->ModelC then Django creates accessors like this: - ModelA: modelb - ModelB: modela_ptr, modelb, modelc - ModelC: modela_ptr, modelb, modelb_ptr, modelc
These accessors allow Django (and everyone else) to travel up and down the inheritance tree for the db object at hand.
The original Django accessors use our polymorphic manager. But they should not. So we replace them with our own accessors that use our appropriate base_objects manager.
Parameters: - id (AutoField) – Id
- polymorphic_ctype (ForeignKey to
django.contrib.contenttypes.models.ContentType
) – Polymorphic ctype - active (BooleanField) – Active
- basketcondition_ptr (OneToOneField to
shuup.campaigns.models.basket_conditions.BasketCondition
) – Basketcondition ptr - contact_groups (ManyToManyField to
shuup.core.models.ContactGroup
) – Contact groups
-
model
¶ alias of
ContactGroup
-
identifier
= 'basket_contact_group_condition'¶
-
name
= 'Contact Group'¶
-
contact_groups
¶ Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.
In the example:
class Pizza(Model): toppings = ManyToManyField(Topping, related_name='pizzas')
Pizza.toppings
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
-
description
¶
-
values
¶
-
exception
DoesNotExist
¶ Bases:
shuup.campaigns.models.basket_conditions.DoesNotExist
-
exception
MultipleObjectsReturned
¶ Bases:
shuup.campaigns.models.basket_conditions.MultipleObjectsReturned
-
basketcondition_ptr
¶ Accessor to the related object on the forward side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Restaurant.place
is aForwardOneToOneDescriptor
instance.
-
basketcondition_ptr_id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
polymorphic_primary_key_name
= 'id'¶
-
polymorphic_super_sub_accessors_replaced
= False¶
-
class
shuup.campaigns.models.basket_conditions.
ContactBasketCondition
(id, polymorphic_ctype, active, basketcondition_ptr)[source]¶ Bases:
shuup.campaigns.models.basket_conditions.BasketCondition
Parameters: - id (AutoField) – Id
- polymorphic_ctype (ForeignKey to
django.contrib.contenttypes.models.ContentType
) – Polymorphic ctype - active (BooleanField) – Active
- basketcondition_ptr (OneToOneField to
shuup.campaigns.models.basket_conditions.BasketCondition
) – Basketcondition ptr - contacts (ManyToManyField to
shuup.core.models.Contact
) – Contacts
Replace Django’s inheritance accessor member functions for our model (self.__class__) with our own versions. We monkey patch them until a patch can be added to Django (which would probably be very small and make all of this obsolete).
If we have inheritance of the form ModelA -> ModelB ->ModelC then Django creates accessors like this: - ModelA: modelb - ModelB: modela_ptr, modelb, modelc - ModelC: modela_ptr, modelb, modelb_ptr, modelc
These accessors allow Django (and everyone else) to travel up and down the inheritance tree for the db object at hand.
The original Django accessors use our polymorphic manager. But they should not. So we replace them with our own accessors that use our appropriate base_objects manager.
Parameters: - id (AutoField) – Id
- polymorphic_ctype (ForeignKey to
django.contrib.contenttypes.models.ContentType
) – Polymorphic ctype - active (BooleanField) – Active
- basketcondition_ptr (OneToOneField to
shuup.campaigns.models.basket_conditions.BasketCondition
) – Basketcondition ptr - contacts (ManyToManyField to
shuup.core.models.Contact
) – Contacts
-
model
¶ alias of
Contact
-
identifier
= 'basket_contact_condition'¶
-
name
= 'Contact'¶
-
contacts
¶ Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.
In the example:
class Pizza(Model): toppings = ManyToManyField(Topping, related_name='pizzas')
Pizza.toppings
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
-
description
¶
-
values
¶
-
exception
DoesNotExist
¶ Bases:
shuup.campaigns.models.basket_conditions.DoesNotExist
-
exception
MultipleObjectsReturned
¶ Bases:
shuup.campaigns.models.basket_conditions.MultipleObjectsReturned
-
basketcondition_ptr
¶ Accessor to the related object on the forward side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Restaurant.place
is aForwardOneToOneDescriptor
instance.
-
basketcondition_ptr_id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
polymorphic_primary_key_name
= 'id'¶
-
polymorphic_super_sub_accessors_replaced
= False¶
-
class
shuup.campaigns.models.basket_conditions.
CategoryProductsBasketCondition
(id, polymorphic_ctype, active, basketcondition_ptr, operator, quantity)[source]¶ Bases:
shuup.campaigns.models.basket_conditions.BasketCondition
Parameters: - id (AutoField) – Id
- polymorphic_ctype (ForeignKey to
django.contrib.contenttypes.models.ContentType
) – Polymorphic ctype - active (BooleanField) – Active
- basketcondition_ptr (OneToOneField to
shuup.campaigns.models.basket_conditions.BasketCondition
) – Basketcondition ptr - operator (EnumIntegerField) – Operator
- quantity (PositiveIntegerField) – Quantity
- categories (ManyToManyField to
shuup.core.models.Category
) – Categories - excluded_categories (ManyToManyField to
shuup.core.models.Category
) – If the customer has even a single product in the basket from these categories this rule won’t match thus the campaign cannot be applied to the basket.
Replace Django’s inheritance accessor member functions for our model (self.__class__) with our own versions. We monkey patch them until a patch can be added to Django (which would probably be very small and make all of this obsolete).
If we have inheritance of the form ModelA -> ModelB ->ModelC then Django creates accessors like this: - ModelA: modelb - ModelB: modela_ptr, modelb, modelc - ModelC: modela_ptr, modelb, modelb_ptr, modelc
These accessors allow Django (and everyone else) to travel up and down the inheritance tree for the db object at hand.
The original Django accessors use our polymorphic manager. But they should not. So we replace them with our own accessors that use our appropriate base_objects manager.
Parameters: - id (AutoField) – Id
- polymorphic_ctype (ForeignKey to
django.contrib.contenttypes.models.ContentType
) – Polymorphic ctype - active (BooleanField) – Active
- basketcondition_ptr (OneToOneField to
shuup.campaigns.models.basket_conditions.BasketCondition
) – Basketcondition ptr - operator (EnumIntegerField) – Operator
- quantity (PositiveIntegerField) – Quantity
- categories (ManyToManyField to
shuup.core.models.Category
) – Categories - excluded_categories (ManyToManyField to
shuup.core.models.Category
) – If the customer has even a single product in the basket from these categories this rule won’t match thus the campaign cannot be applied to the basket.
-
model
¶ alias of
Category
-
identifier
= 'basket_category_condition'¶
-
name
= 'Category products in basket'¶
-
operator
¶ A property descriptor which ensures that
field.to_python()
is called on _every_ assignment to the field.This used to be provided by the
django.db.models.subclassing.Creator
class, which in turn was used by the deprecated-in-Django-1.10SubfieldBase
class, hence the reimplementation here.
-
quantity
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
categories
¶ Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.
In the example:
class Pizza(Model): toppings = ManyToManyField(Topping, related_name='pizzas')
Pizza.toppings
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
-
excluded_categories
¶ Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.
In the example:
class Pizza(Model): toppings = ManyToManyField(Topping, related_name='pizzas')
Pizza.toppings
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
-
description
¶
-
exception
DoesNotExist
¶ Bases:
shuup.campaigns.models.basket_conditions.DoesNotExist
-
exception
MultipleObjectsReturned
¶ Bases:
shuup.campaigns.models.basket_conditions.MultipleObjectsReturned
-
basketcondition_ptr
¶ Accessor to the related object on the forward side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Restaurant.place
is aForwardOneToOneDescriptor
instance.
-
basketcondition_ptr_id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
get_operator_display
(*, field=<enumfields.fields.EnumIntegerField: operator>)¶
-
polymorphic_primary_key_name
= 'id'¶
-
polymorphic_super_sub_accessors_replaced
= False¶
-
class
shuup.campaigns.models.basket_conditions.
HourBasketCondition
(id, polymorphic_ctype, active, basketcondition_ptr, hour_start, hour_end, days)[source]¶ Bases:
shuup.campaigns.models.basket_conditions.BasketCondition
Parameters: - id (AutoField) – Id
- polymorphic_ctype (ForeignKey to
django.contrib.contenttypes.models.ContentType
) – Polymorphic ctype - active (BooleanField) – Active
- basketcondition_ptr (OneToOneField to
shuup.campaigns.models.basket_conditions.BasketCondition
) – Basketcondition ptr - hour_start (TimeField) – 12pm is considered noon and 12am as midnight.
- hour_end (TimeField) – 12pm is considered noon and 12am as midnight. End time is not considered match.
- days (CharField) – Days
Replace Django’s inheritance accessor member functions for our model (self.__class__) with our own versions. We monkey patch them until a patch can be added to Django (which would probably be very small and make all of this obsolete).
If we have inheritance of the form ModelA -> ModelB ->ModelC then Django creates accessors like this: - ModelA: modelb - ModelB: modela_ptr, modelb, modelc - ModelC: modela_ptr, modelb, modelb_ptr, modelc
These accessors allow Django (and everyone else) to travel up and down the inheritance tree for the db object at hand.
The original Django accessors use our polymorphic manager. But they should not. So we replace them with our own accessors that use our appropriate base_objects manager.
Parameters: - id (AutoField) – Id
- polymorphic_ctype (ForeignKey to
django.contrib.contenttypes.models.ContentType
) – Polymorphic ctype - active (BooleanField) – Active
- basketcondition_ptr (OneToOneField to
shuup.campaigns.models.basket_conditions.BasketCondition
) – Basketcondition ptr - hour_start (TimeField) – 12pm is considered noon and 12am as midnight.
- hour_end (TimeField) – 12pm is considered noon and 12am as midnight. End time is not considered match.
- days (CharField) – Days
-
identifier
= 'hour_condition'¶
-
name
= 'Day and hour'¶
-
hour_start
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
hour_end
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
days
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
description
¶
-
values
¶
-
exception
DoesNotExist
¶ Bases:
shuup.campaigns.models.basket_conditions.DoesNotExist
-
exception
MultipleObjectsReturned
¶ Bases:
shuup.campaigns.models.basket_conditions.MultipleObjectsReturned
-
basketcondition_ptr
¶ Accessor to the related object on the forward side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Restaurant.place
is aForwardOneToOneDescriptor
instance.
-
basketcondition_ptr_id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
polymorphic_primary_key_name
= 'id'¶
-
polymorphic_super_sub_accessors_replaced
= False¶
-
class
shuup.campaigns.models.basket_conditions.
ChildrenProductCondition
(id, polymorphic_ctype, active, basketcondition_ptr, product)[source]¶ Bases:
shuup.campaigns.models.basket_conditions.BasketCondition
Parameters: - id (AutoField) – Id
- polymorphic_ctype (ForeignKey to
django.contrib.contenttypes.models.ContentType
) – Polymorphic ctype - active (BooleanField) – Active
- basketcondition_ptr (OneToOneField to
shuup.campaigns.models.basket_conditions.BasketCondition
) – Basketcondition ptr - product (ForeignKey to
shuup.core.models.Product
) – Product
Replace Django’s inheritance accessor member functions for our model (self.__class__) with our own versions. We monkey patch them until a patch can be added to Django (which would probably be very small and make all of this obsolete).
If we have inheritance of the form ModelA -> ModelB ->ModelC then Django creates accessors like this: - ModelA: modelb - ModelB: modela_ptr, modelb, modelc - ModelC: modela_ptr, modelb, modelb_ptr, modelc
These accessors allow Django (and everyone else) to travel up and down the inheritance tree for the db object at hand.
The original Django accessors use our polymorphic manager. But they should not. So we replace them with our own accessors that use our appropriate base_objects manager.
Parameters: - id (AutoField) – Id
- polymorphic_ctype (ForeignKey to
django.contrib.contenttypes.models.ContentType
) – Polymorphic ctype - active (BooleanField) – Active
- basketcondition_ptr (OneToOneField to
shuup.campaigns.models.basket_conditions.BasketCondition
) – Basketcondition ptr - product (ForeignKey to
shuup.core.models.Product
) – Product
-
exception
DoesNotExist
¶ Bases:
shuup.campaigns.models.basket_conditions.DoesNotExist
-
exception
MultipleObjectsReturned
¶ Bases:
shuup.campaigns.models.basket_conditions.MultipleObjectsReturned
-
basketcondition_ptr
¶ Accessor to the related object on the forward side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Restaurant.place
is aForwardOneToOneDescriptor
instance.
-
basketcondition_ptr_id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
polymorphic_primary_key_name
= 'id'¶
-
polymorphic_super_sub_accessors_replaced
= False¶
-
product_id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
identifier
= 'is_product_child_condition'¶
-
name
= 'Product Variation Child'¶
-
model
¶ alias of
Product
-
product
¶ Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
-
description
¶
-
values
¶
shuup.campaigns.models.basket_effects module¶
-
class
shuup.campaigns.models.basket_effects.
BasketDiscountEffect
(id, polymorphic_ctype, campaign)[source]¶ Bases:
shuup.core.models.PolymorphicShuupModel
Parameters: - id (AutoField) – Id
- polymorphic_ctype (ForeignKey to
django.contrib.contenttypes.models.ContentType
) – Polymorphic ctype - campaign (ForeignKey to
shuup.campaigns.models.campaigns.BasketCampaign
) – Campaign
-
basketdiscountamount_set
¶ OneToOneRel to
shuup.campaigns.models.basket_effects.BasketDiscountAmount
-
basketdiscountpercentage_set
¶ OneToOneRel to
shuup.campaigns.models.basket_effects.BasketDiscountPercentage
-
discountpercentagefromundiscounted_set
¶ OneToOneRel to
shuup.campaigns.models.basket_effects.DiscountPercentageFromUndiscounted
Replace Django’s inheritance accessor member functions for our model (self.__class__) with our own versions. We monkey patch them until a patch can be added to Django (which would probably be very small and make all of this obsolete).
If we have inheritance of the form ModelA -> ModelB ->ModelC then Django creates accessors like this: - ModelA: modelb - ModelB: modela_ptr, modelb, modelc - ModelC: modela_ptr, modelb, modelb_ptr, modelc
These accessors allow Django (and everyone else) to travel up and down the inheritance tree for the db object at hand.
The original Django accessors use our polymorphic manager. But they should not. So we replace them with our own accessors that use our appropriate base_objects manager.
Parameters: - id (AutoField) – Id
- polymorphic_ctype (ForeignKey to
django.contrib.contenttypes.models.ContentType
) – Polymorphic ctype - campaign (ForeignKey to
shuup.campaigns.models.campaigns.BasketCampaign
) – Campaign
-
basketdiscountamount_set
OneToOneRel to
shuup.campaigns.models.basket_effects.BasketDiscountAmount
-
basketdiscountpercentage_set
OneToOneRel to
shuup.campaigns.models.basket_effects.BasketDiscountPercentage
-
discountpercentagefromundiscounted_set
OneToOneRel to
shuup.campaigns.models.basket_effects.DiscountPercentageFromUndiscounted
-
identifier
= None¶
-
model
= None¶
-
admin_form_class
= None¶
-
campaign
¶ Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
-
apply_for_basket
(order_source)[source]¶ Applies the effect based on given
order_source
Returns: amount of discount to accumulate for the product Return type: Price
-
exception
DoesNotExist
¶ Bases:
django.core.exceptions.ObjectDoesNotExist
-
exception
MultipleObjectsReturned
¶ Bases:
django.core.exceptions.MultipleObjectsReturned
-
basketdiscountamount
¶ Accessor to the related object on the reverse side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Place.restaurant
is aReverseOneToOneDescriptor
instance.
-
basketdiscountpercentage
¶ Accessor to the related object on the reverse side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Place.restaurant
is aReverseOneToOneDescriptor
instance.
-
campaign_id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
discountpercentagefromundiscounted
¶ Accessor to the related object on the reverse side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Place.restaurant
is aReverseOneToOneDescriptor
instance.
-
id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
polymorphic_ctype
¶ Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
-
polymorphic_primary_key_name
= 'id'¶
-
polymorphic_super_sub_accessors_replaced
= False¶
-
class
shuup.campaigns.models.basket_effects.
BasketDiscountAmount
(id, polymorphic_ctype, campaign, basketdiscounteffect_ptr, discount_amount)[source]¶ Bases:
shuup.campaigns.models.basket_effects.BasketDiscountEffect
Parameters: - id (AutoField) – Id
- polymorphic_ctype (ForeignKey to
django.contrib.contenttypes.models.ContentType
) – Polymorphic ctype - campaign (ForeignKey to
shuup.campaigns.models.campaigns.BasketCampaign
) – Campaign - basketdiscounteffect_ptr (OneToOneField to
shuup.campaigns.models.basket_effects.BasketDiscountEffect
) – Basketdiscounteffect ptr - discount_amount (MoneyValueField) – Flat amount of discount.
Replace Django’s inheritance accessor member functions for our model (self.__class__) with our own versions. We monkey patch them until a patch can be added to Django (which would probably be very small and make all of this obsolete).
If we have inheritance of the form ModelA -> ModelB ->ModelC then Django creates accessors like this: - ModelA: modelb - ModelB: modela_ptr, modelb, modelc - ModelC: modela_ptr, modelb, modelb_ptr, modelc
These accessors allow Django (and everyone else) to travel up and down the inheritance tree for the db object at hand.
The original Django accessors use our polymorphic manager. But they should not. So we replace them with our own accessors that use our appropriate base_objects manager.
Parameters: - id (AutoField) – Id
- polymorphic_ctype (ForeignKey to
django.contrib.contenttypes.models.ContentType
) – Polymorphic ctype - campaign (ForeignKey to
shuup.campaigns.models.campaigns.BasketCampaign
) – Campaign - basketdiscounteffect_ptr (OneToOneField to
shuup.campaigns.models.basket_effects.BasketDiscountEffect
) – Basketdiscounteffect ptr - discount_amount (MoneyValueField) – Flat amount of discount.
-
identifier
= 'discount_amount_effect'¶
-
name
= 'Discount amount value'¶
-
discount_amount
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
description
¶
-
value
¶
-
exception
DoesNotExist
¶ Bases:
shuup.campaigns.models.basket_effects.DoesNotExist
-
exception
MultipleObjectsReturned
¶ Bases:
shuup.campaigns.models.basket_effects.MultipleObjectsReturned
-
basketdiscounteffect_ptr
¶ Accessor to the related object on the forward side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Restaurant.place
is aForwardOneToOneDescriptor
instance.
-
basketdiscounteffect_ptr_id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
polymorphic_primary_key_name
= 'id'¶
-
polymorphic_super_sub_accessors_replaced
= False¶
-
class
shuup.campaigns.models.basket_effects.
BasketDiscountPercentage
(id, polymorphic_ctype, campaign, basketdiscounteffect_ptr, discount_percentage)[source]¶ Bases:
shuup.campaigns.models.basket_effects.BasketDiscountEffect
Parameters: - id (AutoField) – Id
- polymorphic_ctype (ForeignKey to
django.contrib.contenttypes.models.ContentType
) – Polymorphic ctype - campaign (ForeignKey to
shuup.campaigns.models.campaigns.BasketCampaign
) – Campaign - basketdiscounteffect_ptr (OneToOneField to
shuup.campaigns.models.basket_effects.BasketDiscountEffect
) – Basketdiscounteffect ptr - discount_percentage (DecimalField) – The discount percentage for this campaign.
Replace Django’s inheritance accessor member functions for our model (self.__class__) with our own versions. We monkey patch them until a patch can be added to Django (which would probably be very small and make all of this obsolete).
If we have inheritance of the form ModelA -> ModelB ->ModelC then Django creates accessors like this: - ModelA: modelb - ModelB: modela_ptr, modelb, modelc - ModelC: modela_ptr, modelb, modelb_ptr, modelc
These accessors allow Django (and everyone else) to travel up and down the inheritance tree for the db object at hand.
The original Django accessors use our polymorphic manager. But they should not. So we replace them with our own accessors that use our appropriate base_objects manager.
Parameters: - id (AutoField) – Id
- polymorphic_ctype (ForeignKey to
django.contrib.contenttypes.models.ContentType
) – Polymorphic ctype - campaign (ForeignKey to
shuup.campaigns.models.campaigns.BasketCampaign
) – Campaign - basketdiscounteffect_ptr (OneToOneField to
shuup.campaigns.models.basket_effects.BasketDiscountEffect
) – Basketdiscounteffect ptr - discount_percentage (DecimalField) – The discount percentage for this campaign.
-
identifier
= 'discount_percentage_effect'¶
-
name
= 'Discount amount percentage'¶
-
admin_form_class
¶ alias of
PercentageField
-
discount_percentage
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
description
¶
-
value
¶
-
exception
DoesNotExist
¶ Bases:
shuup.campaigns.models.basket_effects.DoesNotExist
-
exception
MultipleObjectsReturned
¶ Bases:
shuup.campaigns.models.basket_effects.MultipleObjectsReturned
-
basketdiscounteffect_ptr
¶ Accessor to the related object on the forward side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Restaurant.place
is aForwardOneToOneDescriptor
instance.
-
basketdiscounteffect_ptr_id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
polymorphic_primary_key_name
= 'id'¶
-
polymorphic_super_sub_accessors_replaced
= False¶
-
class
shuup.campaigns.models.basket_effects.
DiscountPercentageFromUndiscounted
(id, polymorphic_ctype, campaign, basketdiscounteffect_ptr, discount_percentage)[source]¶ Bases:
shuup.campaigns.models.basket_effects.BasketDiscountEffect
Parameters: - id (AutoField) – Id
- polymorphic_ctype (ForeignKey to
django.contrib.contenttypes.models.ContentType
) – Polymorphic ctype - campaign (ForeignKey to
shuup.campaigns.models.campaigns.BasketCampaign
) – Campaign - basketdiscounteffect_ptr (OneToOneField to
shuup.campaigns.models.basket_effects.BasketDiscountEffect
) – Basketdiscounteffect ptr - discount_percentage (DecimalField) – The discount percentage for this campaign.
Replace Django’s inheritance accessor member functions for our model (self.__class__) with our own versions. We monkey patch them until a patch can be added to Django (which would probably be very small and make all of this obsolete).
If we have inheritance of the form ModelA -> ModelB ->ModelC then Django creates accessors like this: - ModelA: modelb - ModelB: modela_ptr, modelb, modelc - ModelC: modela_ptr, modelb, modelb_ptr, modelc
These accessors allow Django (and everyone else) to travel up and down the inheritance tree for the db object at hand.
The original Django accessors use our polymorphic manager. But they should not. So we replace them with our own accessors that use our appropriate base_objects manager.
Parameters: - id (AutoField) – Id
- polymorphic_ctype (ForeignKey to
django.contrib.contenttypes.models.ContentType
) – Polymorphic ctype - campaign (ForeignKey to
shuup.campaigns.models.campaigns.BasketCampaign
) – Campaign - basketdiscounteffect_ptr (OneToOneField to
shuup.campaigns.models.basket_effects.BasketDiscountEffect
) – Basketdiscounteffect ptr - discount_percentage (DecimalField) – The discount percentage for this campaign.
-
identifier
= 'undiscounted_percentage_effect'¶
-
name
= 'Discount amount percentage from undiscounted amount'¶
-
admin_form_class
¶ alias of
PercentageField
-
discount_percentage
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
description
¶
-
exception
DoesNotExist
¶ Bases:
shuup.campaigns.models.basket_effects.DoesNotExist
-
exception
MultipleObjectsReturned
¶ Bases:
shuup.campaigns.models.basket_effects.MultipleObjectsReturned
-
basketdiscounteffect_ptr
¶ Accessor to the related object on the forward side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Restaurant.place
is aForwardOneToOneDescriptor
instance.
-
basketdiscounteffect_ptr_id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
polymorphic_primary_key_name
= 'id'¶
-
polymorphic_super_sub_accessors_replaced
= False¶
-
value
¶
shuup.campaigns.models.basket_line_effects module¶
-
class
shuup.campaigns.models.basket_line_effects.
BasketLineEffect
(id, polymorphic_ctype, campaign)[source]¶ Bases:
shuup.core.models.PolymorphicShuupModel
Parameters: - id (AutoField) – Id
- polymorphic_ctype (ForeignKey to
django.contrib.contenttypes.models.ContentType
) – Polymorphic ctype - campaign (ForeignKey to
shuup.campaigns.models.campaigns.BasketCampaign
) – Campaign
-
freeproductline_set
¶ OneToOneRel to
shuup.campaigns.models.basket_line_effects.FreeProductLine
-
discountfromproduct_set
¶ OneToOneRel to
shuup.campaigns.models.basket_line_effects.DiscountFromProduct
-
discountfromcategoryproducts_set
¶ OneToOneRel to
shuup.campaigns.models.basket_line_effects.DiscountFromCategoryProducts
Replace Django’s inheritance accessor member functions for our model (self.__class__) with our own versions. We monkey patch them until a patch can be added to Django (which would probably be very small and make all of this obsolete).
If we have inheritance of the form ModelA -> ModelB ->ModelC then Django creates accessors like this: - ModelA: modelb - ModelB: modela_ptr, modelb, modelc - ModelC: modela_ptr, modelb, modelb_ptr, modelc
These accessors allow Django (and everyone else) to travel up and down the inheritance tree for the db object at hand.
The original Django accessors use our polymorphic manager. But they should not. So we replace them with our own accessors that use our appropriate base_objects manager.
Parameters: - id (AutoField) – Id
- polymorphic_ctype (ForeignKey to
django.contrib.contenttypes.models.ContentType
) – Polymorphic ctype - campaign (ForeignKey to
shuup.campaigns.models.campaigns.BasketCampaign
) – Campaign
-
freeproductline_set
OneToOneRel to
shuup.campaigns.models.basket_line_effects.FreeProductLine
-
discountfromproduct_set
OneToOneRel to
shuup.campaigns.models.basket_line_effects.DiscountFromProduct
-
discountfromcategoryproducts_set
OneToOneRel to
shuup.campaigns.models.basket_line_effects.DiscountFromCategoryProducts
-
identifier
= None¶
-
model
= None¶
-
admin_form_class
= None¶
-
campaign
¶ Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
-
get_discount_lines
(order_source, original_lines, supplier)[source]¶ Applies the effect based on given
order_source
Returns: amount of discount to accumulate for the product Return type: Iterable[shuup.core.order_creator.SourceLine]
-
exception
DoesNotExist
¶ Bases:
django.core.exceptions.ObjectDoesNotExist
-
exception
MultipleObjectsReturned
¶ Bases:
django.core.exceptions.MultipleObjectsReturned
-
campaign_id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
discountfromcategoryproducts
¶ Accessor to the related object on the reverse side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Place.restaurant
is aReverseOneToOneDescriptor
instance.
-
discountfromproduct
¶ Accessor to the related object on the reverse side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Place.restaurant
is aReverseOneToOneDescriptor
instance.
-
freeproductline
¶ Accessor to the related object on the reverse side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Place.restaurant
is aReverseOneToOneDescriptor
instance.
-
id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
polymorphic_ctype
¶ Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
-
polymorphic_primary_key_name
= 'id'¶
-
polymorphic_super_sub_accessors_replaced
= False¶
-
class
shuup.campaigns.models.basket_line_effects.
FreeProductLine
(id, polymorphic_ctype, campaign, basketlineeffect_ptr, quantity)[source]¶ Bases:
shuup.campaigns.models.basket_line_effects.BasketLineEffect
Parameters: - id (AutoField) – Id
- polymorphic_ctype (ForeignKey to
django.contrib.contenttypes.models.ContentType
) – Polymorphic ctype - campaign (ForeignKey to
shuup.campaigns.models.campaigns.BasketCampaign
) – Campaign - basketlineeffect_ptr (OneToOneField to
shuup.campaigns.models.basket_line_effects.BasketLineEffect
) – Basketlineeffect ptr - quantity (QuantityField) – Quantity
- products (ManyToManyField to
shuup.core.models.Product
) – Product
Replace Django’s inheritance accessor member functions for our model (self.__class__) with our own versions. We monkey patch them until a patch can be added to Django (which would probably be very small and make all of this obsolete).
If we have inheritance of the form ModelA -> ModelB ->ModelC then Django creates accessors like this: - ModelA: modelb - ModelB: modela_ptr, modelb, modelc - ModelC: modela_ptr, modelb, modelb_ptr, modelc
These accessors allow Django (and everyone else) to travel up and down the inheritance tree for the db object at hand.
The original Django accessors use our polymorphic manager. But they should not. So we replace them with our own accessors that use our appropriate base_objects manager.
Parameters: - id (AutoField) – Id
- polymorphic_ctype (ForeignKey to
django.contrib.contenttypes.models.ContentType
) – Polymorphic ctype - campaign (ForeignKey to
shuup.campaigns.models.campaigns.BasketCampaign
) – Campaign - basketlineeffect_ptr (OneToOneField to
shuup.campaigns.models.basket_line_effects.BasketLineEffect
) – Basketlineeffect ptr - quantity (QuantityField) – Quantity
- products (ManyToManyField to
shuup.core.models.Product
) – Product
-
identifier
= 'free_product_line_effect'¶
-
model
¶ alias of
Product
-
name
= 'Free Product(s)'¶
-
quantity
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
products
¶ Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.
In the example:
class Pizza(Model): toppings = ManyToManyField(Topping, related_name='pizzas')
Pizza.toppings
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
-
description
¶
-
values
¶
-
exception
DoesNotExist
¶ Bases:
shuup.campaigns.models.basket_line_effects.DoesNotExist
-
exception
MultipleObjectsReturned
¶ Bases:
shuup.campaigns.models.basket_line_effects.MultipleObjectsReturned
-
basketlineeffect_ptr
¶ Accessor to the related object on the forward side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Restaurant.place
is aForwardOneToOneDescriptor
instance.
-
basketlineeffect_ptr_id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
polymorphic_primary_key_name
= 'id'¶
-
polymorphic_super_sub_accessors_replaced
= False¶
-
class
shuup.campaigns.models.basket_line_effects.
DiscountFromProduct
(id, polymorphic_ctype, campaign, basketlineeffect_ptr, per_line_discount, discount_amount)[source]¶ Bases:
shuup.campaigns.models.basket_line_effects.BasketLineEffect
Parameters: - id (AutoField) – Id
- polymorphic_ctype (ForeignKey to
django.contrib.contenttypes.models.ContentType
) – Polymorphic ctype - campaign (ForeignKey to
shuup.campaigns.models.campaigns.BasketCampaign
) – Campaign - basketlineeffect_ptr (OneToOneField to
shuup.campaigns.models.basket_line_effects.BasketLineEffect
) – Basketlineeffect ptr - per_line_discount (BooleanField) – Disable this if you want to give discount for each matched product.
- discount_amount (MoneyValueField) – Flat amount of discount.
- products (ManyToManyField to
shuup.core.models.Product
) – Product
Replace Django’s inheritance accessor member functions for our model (self.__class__) with our own versions. We monkey patch them until a patch can be added to Django (which would probably be very small and make all of this obsolete).
If we have inheritance of the form ModelA -> ModelB ->ModelC then Django creates accessors like this: - ModelA: modelb - ModelB: modela_ptr, modelb, modelc - ModelC: modela_ptr, modelb, modelb_ptr, modelc
These accessors allow Django (and everyone else) to travel up and down the inheritance tree for the db object at hand.
The original Django accessors use our polymorphic manager. But they should not. So we replace them with our own accessors that use our appropriate base_objects manager.
Parameters: - id (AutoField) – Id
- polymorphic_ctype (ForeignKey to
django.contrib.contenttypes.models.ContentType
) – Polymorphic ctype - campaign (ForeignKey to
shuup.campaigns.models.campaigns.BasketCampaign
) – Campaign - basketlineeffect_ptr (OneToOneField to
shuup.campaigns.models.basket_line_effects.BasketLineEffect
) – Basketlineeffect ptr - per_line_discount (BooleanField) – Disable this if you want to give discount for each matched product.
- discount_amount (MoneyValueField) – Flat amount of discount.
- products (ManyToManyField to
shuup.core.models.Product
) – Product
-
identifier
= 'discount_from_product_line_effect'¶
-
model
¶ alias of
Product
-
name
= 'Discount from Product'¶
-
per_line_discount
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
discount_amount
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
products
¶ Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.
In the example:
class Pizza(Model): toppings = ManyToManyField(Topping, related_name='pizzas')
Pizza.toppings
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
-
description
¶
-
exception
DoesNotExist
¶ Bases:
shuup.campaigns.models.basket_line_effects.DoesNotExist
-
exception
MultipleObjectsReturned
¶ Bases:
shuup.campaigns.models.basket_line_effects.MultipleObjectsReturned
-
basketlineeffect_ptr
¶ Accessor to the related object on the forward side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Restaurant.place
is aForwardOneToOneDescriptor
instance.
-
basketlineeffect_ptr_id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
polymorphic_primary_key_name
= 'id'¶
-
polymorphic_super_sub_accessors_replaced
= False¶
-
class
shuup.campaigns.models.basket_line_effects.
DiscountFromCategoryProducts
(id, polymorphic_ctype, campaign, basketlineeffect_ptr, discount_amount, discount_percentage, category)[source]¶ Bases:
shuup.campaigns.models.basket_line_effects.BasketLineEffect
Parameters: - id (AutoField) – Id
- polymorphic_ctype (ForeignKey to
django.contrib.contenttypes.models.ContentType
) – Polymorphic ctype - campaign (ForeignKey to
shuup.campaigns.models.campaigns.BasketCampaign
) – Campaign - basketlineeffect_ptr (OneToOneField to
shuup.campaigns.models.basket_line_effects.BasketLineEffect
) – Basketlineeffect ptr - discount_amount (MoneyValueField) – Flat amount of discount.
- discount_percentage (DecimalField) – The discount percentage for this campaign.
- category (ForeignKey to
shuup.core.models.Category
) – Category
Replace Django’s inheritance accessor member functions for our model (self.__class__) with our own versions. We monkey patch them until a patch can be added to Django (which would probably be very small and make all of this obsolete).
If we have inheritance of the form ModelA -> ModelB ->ModelC then Django creates accessors like this: - ModelA: modelb - ModelB: modela_ptr, modelb, modelc - ModelC: modela_ptr, modelb, modelb_ptr, modelc
These accessors allow Django (and everyone else) to travel up and down the inheritance tree for the db object at hand.
The original Django accessors use our polymorphic manager. But they should not. So we replace them with our own accessors that use our appropriate base_objects manager.
Parameters: - id (AutoField) – Id
- polymorphic_ctype (ForeignKey to
django.contrib.contenttypes.models.ContentType
) – Polymorphic ctype - campaign (ForeignKey to
shuup.campaigns.models.campaigns.BasketCampaign
) – Campaign - basketlineeffect_ptr (OneToOneField to
shuup.campaigns.models.basket_line_effects.BasketLineEffect
) – Basketlineeffect ptr - discount_amount (MoneyValueField) – Flat amount of discount.
- discount_percentage (DecimalField) – The discount percentage for this campaign.
- category (ForeignKey to
shuup.core.models.Category
) – Category
-
identifier
= 'discount_from_category_products_line_effect'¶
-
model
¶ alias of
Category
-
name
= 'Discount from Category products'¶
-
discount_amount
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
discount_percentage
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
category
¶ Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
-
description
¶
-
exception
DoesNotExist
¶ Bases:
shuup.campaigns.models.basket_line_effects.DoesNotExist
-
exception
MultipleObjectsReturned
¶ Bases:
shuup.campaigns.models.basket_line_effects.MultipleObjectsReturned
-
basketlineeffect_ptr
¶ Accessor to the related object on the forward side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Restaurant.place
is aForwardOneToOneDescriptor
instance.
-
basketlineeffect_ptr_id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
category_id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
polymorphic_primary_key_name
= 'id'¶
-
polymorphic_super_sub_accessors_replaced
= False¶
shuup.campaigns.models.cache module¶
-
class
shuup.campaigns.models.cache.
CatalogFilterCachedShopProduct
(id, filter, shop_product)[source]¶ Bases:
django.db.models.base.Model
Parameters: - id (AutoField) – Id
- filter (ForeignKey to
shuup.campaigns.models.catalog_filters.CatalogFilter
) – Filter - shop_product (ForeignKey to
shuup.core.models.ShopProduct
) – Shop product
-
filter
¶ Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
-
shop_product
¶ Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
-
exception
DoesNotExist
¶ Bases:
django.core.exceptions.ObjectDoesNotExist
-
exception
MultipleObjectsReturned
¶ Bases:
django.core.exceptions.MultipleObjectsReturned
-
filter_id
¶ 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>¶
-
shop_product_id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
shuup.campaigns.models.campaigns module¶
-
class
shuup.campaigns.models.campaigns.
CampaignType
[source]¶ Bases:
enumfields.enums.Enum
An enumeration.
-
CATALOG
= 1¶
-
BASKET
= 2¶
-
-
class
shuup.campaigns.models.campaigns.
CampaignQueryset
(model=None, query=None, using=None, hints=None)[source]¶ Bases:
django.db.models.query.QuerySet
-
class
shuup.campaigns.models.campaigns.
Campaign
(*args, **kwargs)[source]¶ Bases:
shuup.utils.properties.MoneyPropped
,parler.models.TranslatableModel
Parameters: - shop (ForeignKey to
shuup.core.models.Shop
) – The shop where the campaign is active. - name (CharField) – The name for this campaign.
- identifier (InternalIdentifierField) – Do not change this value if you are not sure what you are doing.
- active (BooleanField) – Enable this if the campaign is currently active. Please also set a start and an end date.
- start_datetime (DateTimeField) – The date and time the campaign starts. This is only applicable if the campaign is marked as active.
- end_datetime (DateTimeField) – The date and time the campaign ends. This is only applicable if the campaign is marked as active.
- created_by (ForeignKey to
django.contrib.auth.models.User
) – Created by - modified_by (ForeignKey to
django.contrib.auth.models.User
) – Modified by - created_on (DateTimeField) – Created on
- modified_on (DateTimeField) – Modified on
-
admin_url_suffix
= None¶
-
shop
¶ Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
-
name
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
identifier
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
active
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
start_datetime
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
end_datetime
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
created_by
¶ Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
-
modified_by
¶ Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
-
created_on
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
modified_on
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
objects
¶
-
class
Meta
[source]¶ Bases:
object
-
abstract
= False¶
-
verbose_name
= 'Campaign'¶
-
verbose_name_plural
= 'Campaigns'¶
-
-
type
¶
-
created_by_id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
get_next_by_created_on
(*, field=<django.db.models.fields.DateTimeField: created_on>, is_next=True, **kwargs)¶
-
get_next_by_modified_on
(*, field=<django.db.models.fields.DateTimeField: modified_on>, is_next=True, **kwargs)¶
-
get_previous_by_created_on
(*, field=<django.db.models.fields.DateTimeField: created_on>, is_next=False, **kwargs)¶
-
get_previous_by_modified_on
(*, field=<django.db.models.fields.DateTimeField: modified_on>, is_next=False, **kwargs)¶
-
modified_by_id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
shop_id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- shop (ForeignKey to
-
class
shuup.campaigns.models.campaigns.
CatalogCampaign
(id, shop, name, identifier, active, start_datetime, end_datetime, created_by, modified_by, created_on, modified_on)[source]¶ Bases:
shuup.campaigns.models.campaigns.Campaign
Parameters: - id (AutoField) – Id
- shop (ForeignKey to
shuup.core.models.Shop
) – The shop where the campaign is active. - name (CharField) – The name for this campaign.
- identifier (InternalIdentifierField) – Do not change this value if you are not sure what you are doing.
- active (BooleanField) – Enable this if the campaign is currently active. Please also set a start and an end date.
- start_datetime (DateTimeField) – The date and time the campaign starts. This is only applicable if the campaign is marked as active.
- end_datetime (DateTimeField) – The date and time the campaign ends. This is only applicable if the campaign is marked as active.
- created_by (ForeignKey to
django.contrib.auth.models.User
) – Created by - modified_by (ForeignKey to
django.contrib.auth.models.User
) – Modified by - created_on (DateTimeField) – Created on
- modified_on (DateTimeField) – Modified on
- conditions (ManyToManyField to
shuup.campaigns.models.context_conditions.ContextCondition
) – Conditions - filters (ManyToManyField to
shuup.campaigns.models.catalog_filters.CatalogFilter
) – Filters - public_name (CharField) – (Translatable) The campaign name to show in the store front.
-
translations
¶ ManyToOneRel to
shuup.campaigns.models.campaigns.CatalogCampaignTranslation
-
log_entries
¶ ManyToOneRel to
shuup.campaigns.models.campaigns.CatalogCampaignLogEntry
-
effects
¶ ManyToOneRel to
shuup.campaigns.models.product_effects.ProductDiscountEffect
-
admin_url_suffix
= 'catalog_campaign'¶
-
conditions
¶ Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.
In the example:
class Pizza(Model): toppings = ManyToManyField(Topping, related_name='pizzas')
Pizza.toppings
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
-
filters
¶ Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.
In the example:
class Pizza(Model): toppings = ManyToManyField(Topping, related_name='pizzas')
Pizza.toppings
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
-
translations
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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
-
exception
DoesNotExist
¶ Bases:
django.core.exceptions.ObjectDoesNotExist
-
exception
MultipleObjectsReturned
¶ Bases:
django.core.exceptions.MultipleObjectsReturned
-
add_log_entry
(message, identifier=None, kind=<LogEntryKind.OTHER: 0>, user=None, extra=None, save=True)¶
-
created_by
¶ Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
-
effects
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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
-
get_next_by_created_on
(*, field=<django.db.models.fields.DateTimeField: created_on>, is_next=True, **kwargs)¶
-
get_next_by_modified_on
(*, field=<django.db.models.fields.DateTimeField: modified_on>, is_next=True, **kwargs)¶
-
get_previous_by_created_on
(*, field=<django.db.models.fields.DateTimeField: created_on>, is_next=False, **kwargs)¶
-
get_previous_by_modified_on
(*, field=<django.db.models.fields.DateTimeField: modified_on>, is_next=False, **kwargs)¶
-
id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
log_entries
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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
-
modified_by
¶ Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
-
public_name
¶ Descriptor for translated attributes.
This attribute proxies all get/set calls to the translated model.
-
shop
¶ Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
-
class
shuup.campaigns.models.campaigns.
BasketCampaign
(id, shop, name, identifier, active, start_datetime, end_datetime, created_by, modified_by, created_on, modified_on, basket_line_text, coupon, supplier)[source]¶ Bases:
shuup.campaigns.models.campaigns.Campaign
Parameters: - id (AutoField) – Id
- shop (ForeignKey to
shuup.core.models.Shop
) – The shop where the campaign is active. - name (CharField) – The name for this campaign.
- identifier (InternalIdentifierField) – Do not change this value if you are not sure what you are doing.
- active (BooleanField) – Enable this if the campaign is currently active. Please also set a start and an end date.
- start_datetime (DateTimeField) – The date and time the campaign starts. This is only applicable if the campaign is marked as active.
- end_datetime (DateTimeField) – The date and time the campaign ends. This is only applicable if the campaign is marked as active.
- created_by (ForeignKey to
django.contrib.auth.models.User
) – Created by - modified_by (ForeignKey to
django.contrib.auth.models.User
) – Modified by - created_on (DateTimeField) – Created on
- modified_on (DateTimeField) – Modified on
- basket_line_text (CharField) – This text will be shown in a basket.
- coupon (OneToOneField to
shuup.campaigns.models.campaigns.Coupon
) – Coupon - supplier (ForeignKey to
shuup.core.models.Supplier
) – When set, this campaign will match only products from the selected supplier. Rules and Effects will also be restricted to include only the products of this supplier. - conditions (ManyToManyField to
shuup.campaigns.models.basket_conditions.BasketCondition
) – Conditions - public_name (CharField) – (Translatable) The campaign name to show in the store front.
-
discount_effects
¶ ManyToOneRel to
shuup.campaigns.models.basket_effects.BasketDiscountEffect
-
line_effects
¶ ManyToOneRel to
shuup.campaigns.models.basket_line_effects.BasketLineEffect
-
translations
¶ ManyToOneRel to
shuup.campaigns.models.campaigns.BasketCampaignTranslation
-
log_entries
¶ ManyToOneRel to
shuup.campaigns.models.campaigns.BasketCampaignLogEntry
-
admin_url_suffix
= 'basket_campaign'¶
-
basket_line_text
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
conditions
¶ Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.
In the example:
class Pizza(Model): toppings = ManyToManyField(Topping, related_name='pizzas')
Pizza.toppings
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
-
coupon
¶ Accessor to the related object on the forward side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Restaurant.place
is aForwardOneToOneDescriptor
instance.
-
supplier
¶ Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
-
translations
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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
-
rules_match
(basket, lines)[source]¶ Check if basket rules match.
They will not match if: 1) The campaign is not active 2) The campaign has attached coupon,
which doesn’t match or is not active- Any of the attached rules don’t match
-
exception
DoesNotExist
¶ Bases:
django.core.exceptions.ObjectDoesNotExist
-
exception
MultipleObjectsReturned
¶ Bases:
django.core.exceptions.MultipleObjectsReturned
-
add_log_entry
(message, identifier=None, kind=<LogEntryKind.OTHER: 0>, user=None, extra=None, save=True)¶
-
coupon_id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
created_by
¶ Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
-
discount_effects
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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
-
get_next_by_created_on
(*, field=<django.db.models.fields.DateTimeField: created_on>, is_next=True, **kwargs)¶
-
get_next_by_modified_on
(*, field=<django.db.models.fields.DateTimeField: modified_on>, is_next=True, **kwargs)¶
-
get_previous_by_created_on
(*, field=<django.db.models.fields.DateTimeField: created_on>, is_next=False, **kwargs)¶
-
get_previous_by_modified_on
(*, field=<django.db.models.fields.DateTimeField: modified_on>, is_next=False, **kwargs)¶
-
id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
line_effects
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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
-
log_entries
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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
-
modified_by
¶ Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
-
public_name
¶ Descriptor for translated attributes.
This attribute proxies all get/set calls to the translated model.
-
shop
¶ Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
-
supplier_id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
class
shuup.campaigns.models.campaigns.
CouponUsage
(id, coupon, order, created_by, modified_by, created_on, modified_on)[source]¶ Bases:
django.db.models.base.Model
Parameters: - id (AutoField) – Id
- coupon (ForeignKey to
shuup.campaigns.models.campaigns.Coupon
) – Coupon - order (ForeignKey to
shuup.core.models.Order
) – Order - created_by (ForeignKey to
django.contrib.auth.models.User
) – Created by - modified_by (ForeignKey to
django.contrib.auth.models.User
) – Modified by - created_on (DateTimeField) – Created on
- modified_on (DateTimeField) – Modified on
-
log_entries
¶ ManyToOneRel to
shuup.campaigns.models.campaigns.CouponUsageLogEntry
-
coupon
¶ Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
-
order
¶ Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
-
created_by
¶ Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
-
modified_by
¶ Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
-
created_on
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
modified_on
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
exception
DoesNotExist
¶ Bases:
django.core.exceptions.ObjectDoesNotExist
-
exception
MultipleObjectsReturned
¶ Bases:
django.core.exceptions.MultipleObjectsReturned
-
add_log_entry
(message, identifier=None, kind=<LogEntryKind.OTHER: 0>, user=None, extra=None, save=True)¶
-
coupon_id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
created_by_id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
get_next_by_created_on
(*, field=<django.db.models.fields.DateTimeField: created_on>, is_next=True, **kwargs)¶
-
get_next_by_modified_on
(*, field=<django.db.models.fields.DateTimeField: modified_on>, is_next=True, **kwargs)¶
-
get_previous_by_created_on
(*, field=<django.db.models.fields.DateTimeField: created_on>, is_next=False, **kwargs)¶
-
get_previous_by_modified_on
(*, field=<django.db.models.fields.DateTimeField: modified_on>, is_next=False, **kwargs)¶
-
id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
log_entries
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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
-
modified_by_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>¶
-
order_id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
class
shuup.campaigns.models.campaigns.
Coupon
(id, code, usage_limit_customer, usage_limit, active, shop, supplier, created_by, modified_by, created_on, modified_on)[source]¶ Bases:
django.db.models.base.Model
Parameters: - id (AutoField) – Id
- code (CharField) – Code
- usage_limit_customer (PositiveIntegerField) – Limit the amount of usages per a single customer.
- usage_limit (PositiveIntegerField) – Set the absolute limit of usages for this coupon. If the limit is zero (0), coupon can’t be used.
- active (BooleanField) – Is active
- shop (ForeignKey to
shuup.core.models.Shop
) – The shop where the coupon is active. - supplier (ForeignKey to
shuup.core.models.Supplier
) – Supplier - created_by (ForeignKey to
django.contrib.auth.models.User
) – Created by - modified_by (ForeignKey to
django.contrib.auth.models.User
) – Modified by - created_on (DateTimeField) – Created on
- modified_on (DateTimeField) – Modified on
-
campaign
¶ OneToOneRel to
shuup.campaigns.models.campaigns.BasketCampaign
-
usages
¶ ManyToOneRel to
shuup.campaigns.models.campaigns.CouponUsage
-
log_entries
¶ ManyToOneRel to
shuup.campaigns.models.campaigns.CouponLogEntry
-
admin_url_suffix
= 'coupon'¶
-
name_field
= 'code'¶
-
search_fields
= ['code']¶
-
code
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
usage_limit_customer
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
usage_limit
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
active
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
shop
¶ Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
-
supplier
¶ Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
-
created_by
¶ Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
-
modified_by
¶ Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
-
created_on
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
modified_on
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
exhausted
¶
-
attached
¶
-
can_use_code
(customer)[source]¶ Check if customer can use the code.
Parameters: customer ( Contact
or None) –Return type: True|False
-
has_been_used
(usage_count=1)[source]¶ See if code was already used the number of maximum times given
-
exception
DoesNotExist
¶ Bases:
django.core.exceptions.ObjectDoesNotExist
-
exception
MultipleObjectsReturned
¶ Bases:
django.core.exceptions.MultipleObjectsReturned
-
add_log_entry
(message, identifier=None, kind=<LogEntryKind.OTHER: 0>, user=None, extra=None, save=True)¶
-
campaign
Accessor to the related object on the reverse side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Place.restaurant
is aReverseOneToOneDescriptor
instance.
-
created_by_id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
get_next_by_created_on
(*, field=<django.db.models.fields.DateTimeField: created_on>, is_next=True, **kwargs)¶
-
get_next_by_modified_on
(*, field=<django.db.models.fields.DateTimeField: modified_on>, is_next=True, **kwargs)¶
-
get_previous_by_created_on
(*, field=<django.db.models.fields.DateTimeField: created_on>, is_next=False, **kwargs)¶
-
get_previous_by_modified_on
(*, field=<django.db.models.fields.DateTimeField: modified_on>, is_next=False, **kwargs)¶
-
id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
log_entries
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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
-
modified_by_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>¶
-
shop_id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
supplier_id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
usages
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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
-
class
shuup.campaigns.models.campaigns.
CatalogCampaignLogEntry
(id, created_on, user, message, identifier, kind, extra, target)¶ Bases:
shuup.utils.analog.BaseLogEntry
Parameters: - id (AutoField) – Id
- created_on (DateTimeField) – Created on
- user (ForeignKey to
django.contrib.auth.models.User
) – User - message (CharField) – Message
- identifier (CharField) – Identifier
- kind (EnumIntegerField) – Log entry kind
- extra (JSONField) – Extra data
- target (ForeignKey to
shuup.campaigns.models.campaigns.CatalogCampaign
) – Target
-
exception
DoesNotExist
¶ Bases:
django.core.exceptions.ObjectDoesNotExist
-
exception
MultipleObjectsReturned
¶ Bases:
django.core.exceptions.MultipleObjectsReturned
-
extra
¶ A placeholder class that provides a way to set the attribute on the model.
-
get_next_by_created_on
(*, field=<django.db.models.fields.DateTimeField: created_on>, is_next=True, **kwargs)¶
-
get_previous_by_created_on
(*, field=<django.db.models.fields.DateTimeField: created_on>, is_next=False, **kwargs)¶
-
id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
kind
¶ A property descriptor which ensures that
field.to_python()
is called on _every_ assignment to the field.This used to be provided by the
django.db.models.subclassing.Creator
class, which in turn was used by the deprecated-in-Django-1.10SubfieldBase
class, hence the reimplementation here.
-
logged_model
¶ alias of
CatalogCampaign
-
objects
= <django.db.models.manager.Manager object>¶
-
target
¶ Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
-
target_id
¶ 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 (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
-
class
shuup.campaigns.models.campaigns.
BasketCampaignLogEntry
(id, created_on, user, message, identifier, kind, extra, target)¶ Bases:
shuup.utils.analog.BaseLogEntry
Parameters: - id (AutoField) – Id
- created_on (DateTimeField) – Created on
- user (ForeignKey to
django.contrib.auth.models.User
) – User - message (CharField) – Message
- identifier (CharField) – Identifier
- kind (EnumIntegerField) – Log entry kind
- extra (JSONField) – Extra data
- target (ForeignKey to
shuup.campaigns.models.campaigns.BasketCampaign
) – Target
-
exception
DoesNotExist
¶ Bases:
django.core.exceptions.ObjectDoesNotExist
-
exception
MultipleObjectsReturned
¶ Bases:
django.core.exceptions.MultipleObjectsReturned
-
extra
¶ A placeholder class that provides a way to set the attribute on the model.
-
get_next_by_created_on
(*, field=<django.db.models.fields.DateTimeField: created_on>, is_next=True, **kwargs)¶
-
get_previous_by_created_on
(*, field=<django.db.models.fields.DateTimeField: created_on>, is_next=False, **kwargs)¶
-
id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
kind
¶ A property descriptor which ensures that
field.to_python()
is called on _every_ assignment to the field.This used to be provided by the
django.db.models.subclassing.Creator
class, which in turn was used by the deprecated-in-Django-1.10SubfieldBase
class, hence the reimplementation here.
-
logged_model
¶ alias of
BasketCampaign
-
objects
= <django.db.models.manager.Manager object>¶
-
target
¶ Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
-
target_id
¶ 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 (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
-
class
shuup.campaigns.models.campaigns.
CouponLogEntry
(id, created_on, user, message, identifier, kind, extra, target)¶ Bases:
shuup.utils.analog.BaseLogEntry
Parameters: - id (AutoField) – Id
- created_on (DateTimeField) – Created on
- user (ForeignKey to
django.contrib.auth.models.User
) – User - message (CharField) – Message
- identifier (CharField) – Identifier
- kind (EnumIntegerField) – Log entry kind
- extra (JSONField) – Extra data
- target (ForeignKey to
shuup.campaigns.models.campaigns.Coupon
) – Target
-
exception
DoesNotExist
¶ Bases:
django.core.exceptions.ObjectDoesNotExist
-
exception
MultipleObjectsReturned
¶ Bases:
django.core.exceptions.MultipleObjectsReturned
-
extra
¶ A placeholder class that provides a way to set the attribute on the model.
-
get_next_by_created_on
(*, field=<django.db.models.fields.DateTimeField: created_on>, is_next=True, **kwargs)¶
-
get_previous_by_created_on
(*, field=<django.db.models.fields.DateTimeField: created_on>, is_next=False, **kwargs)¶
-
id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
kind
¶ A property descriptor which ensures that
field.to_python()
is called on _every_ assignment to the field.This used to be provided by the
django.db.models.subclassing.Creator
class, which in turn was used by the deprecated-in-Django-1.10SubfieldBase
class, hence the reimplementation here.
-
objects
= <django.db.models.manager.Manager object>¶
-
target
¶ Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
-
target_id
¶ 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 (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
-
class
shuup.campaigns.models.campaigns.
CouponUsageLogEntry
(id, created_on, user, message, identifier, kind, extra, target)¶ Bases:
shuup.utils.analog.BaseLogEntry
Parameters: - id (AutoField) – Id
- created_on (DateTimeField) – Created on
- user (ForeignKey to
django.contrib.auth.models.User
) – User - message (CharField) – Message
- identifier (CharField) – Identifier
- kind (EnumIntegerField) – Log entry kind
- extra (JSONField) – Extra data
- target (ForeignKey to
shuup.campaigns.models.campaigns.CouponUsage
) – Target
-
exception
DoesNotExist
¶ Bases:
django.core.exceptions.ObjectDoesNotExist
-
exception
MultipleObjectsReturned
¶ Bases:
django.core.exceptions.MultipleObjectsReturned
-
extra
¶ A placeholder class that provides a way to set the attribute on the model.
-
get_next_by_created_on
(*, field=<django.db.models.fields.DateTimeField: created_on>, is_next=True, **kwargs)¶
-
get_previous_by_created_on
(*, field=<django.db.models.fields.DateTimeField: created_on>, is_next=False, **kwargs)¶
-
id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
kind
¶ A property descriptor which ensures that
field.to_python()
is called on _every_ assignment to the field.This used to be provided by the
django.db.models.subclassing.Creator
class, which in turn was used by the deprecated-in-Django-1.10SubfieldBase
class, hence the reimplementation here.
-
logged_model
¶ alias of
CouponUsage
-
objects
= <django.db.models.manager.Manager object>¶
-
target
¶ Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
-
target_id
¶ 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 (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
-
class
shuup.campaigns.models.campaigns.
BasketCampaignTranslation
(id, language_code, public_name, master)¶ Bases:
parler.models.TranslatedFieldsModel
Parameters: - id (AutoField) – Id
- language_code (HideChoicesCharField) – Language
- public_name (CharField) – The campaign name to show in the store front.
- master (TranslationsForeignKey to
shuup.campaigns.models.campaigns.BasketCampaign
) – Master
-
exception
DoesNotExist
¶ Bases:
parler.models.TranslationDoesNotExist
,shuup.campaigns.models.campaigns.DoesNotExist
,shuup.campaigns.models.campaigns.DoesNotExist
-
exception
MultipleObjectsReturned
¶ Bases:
django.core.exceptions.MultipleObjectsReturned
-
id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
master
¶ Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
-
master_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>¶
-
public_name
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
class
shuup.campaigns.models.campaigns.
CatalogCampaignTranslation
(id, language_code, public_name, master)¶ Bases:
parler.models.TranslatedFieldsModel
Parameters: - id (AutoField) – Id
- language_code (HideChoicesCharField) – Language
- public_name (CharField) – The campaign name to show in the store front.
- master (TranslationsForeignKey to
shuup.campaigns.models.campaigns.CatalogCampaign
) – Master
-
exception
DoesNotExist
¶ Bases:
parler.models.TranslationDoesNotExist
,shuup.campaigns.models.campaigns.DoesNotExist
,shuup.campaigns.models.campaigns.DoesNotExist
-
exception
MultipleObjectsReturned
¶ Bases:
django.core.exceptions.MultipleObjectsReturned
-
id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
master
¶ Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
-
master_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>¶
-
public_name
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
shuup.campaigns.models.catalog_filters module¶
-
class
shuup.campaigns.models.catalog_filters.
CatalogFilter
(id, polymorphic_ctype, active)[source]¶ Bases:
polymorphic.models.PolymorphicModel
Parameters: - id (AutoField) – Id
- polymorphic_ctype (ForeignKey to
django.contrib.contenttypes.models.ContentType
) – Polymorphic ctype - active (BooleanField) – Active
-
cached_shop_products
¶ ManyToOneRel to
shuup.campaigns.models.cache.CatalogFilterCachedShopProduct
-
producttypefilter_set
¶ OneToOneRel to
shuup.campaigns.models.catalog_filters.ProductTypeFilter
-
productfilter_set
¶ OneToOneRel to
shuup.campaigns.models.catalog_filters.ProductFilter
-
categoryfilter_set
¶ OneToOneRel to
shuup.campaigns.models.catalog_filters.CategoryFilter
Replace Django’s inheritance accessor member functions for our model (self.__class__) with our own versions. We monkey patch them until a patch can be added to Django (which would probably be very small and make all of this obsolete).
If we have inheritance of the form ModelA -> ModelB ->ModelC then Django creates accessors like this: - ModelA: modelb - ModelB: modela_ptr, modelb, modelc - ModelC: modela_ptr, modelb, modelb_ptr, modelc
These accessors allow Django (and everyone else) to travel up and down the inheritance tree for the db object at hand.
The original Django accessors use our polymorphic manager. But they should not. So we replace them with our own accessors that use our appropriate base_objects manager.
Parameters: - id (AutoField) – Id
- polymorphic_ctype (ForeignKey to
django.contrib.contenttypes.models.ContentType
) – Polymorphic ctype - active (BooleanField) – Active
-
cached_shop_products
ManyToOneRel to
shuup.campaigns.models.cache.CatalogFilterCachedShopProduct
-
producttypefilter_set
OneToOneRel to
shuup.campaigns.models.catalog_filters.ProductTypeFilter
-
productfilter_set
OneToOneRel to
shuup.campaigns.models.catalog_filters.ProductFilter
-
categoryfilter_set
OneToOneRel to
shuup.campaigns.models.catalog_filters.CategoryFilter
-
model
= None¶
-
identifier
= 'base_catalog_filter'¶
-
name
= 'Base Catalog Filter'¶
-
active
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
exception
DoesNotExist
¶ Bases:
django.core.exceptions.ObjectDoesNotExist
-
exception
MultipleObjectsReturned
¶ Bases:
django.core.exceptions.MultipleObjectsReturned
-
cached_shop_products
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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
-
campaign
¶ Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.
In the example:
class Pizza(Model): toppings = ManyToManyField(Topping, related_name='pizzas')
Pizza.toppings
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
-
categoryfilter
¶ Accessor to the related object on the reverse side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Place.restaurant
is aReverseOneToOneDescriptor
instance.
-
id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
polymorphic_ctype
¶ Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
-
polymorphic_primary_key_name
= 'id'¶
-
polymorphic_super_sub_accessors_replaced
= False¶
-
productfilter
¶ Accessor to the related object on the reverse side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Place.restaurant
is aReverseOneToOneDescriptor
instance.
-
producttypefilter
¶ Accessor to the related object on the reverse side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Place.restaurant
is aReverseOneToOneDescriptor
instance.
-
class
shuup.campaigns.models.catalog_filters.
ProductTypeFilter
(id, polymorphic_ctype, active, catalogfilter_ptr)[source]¶ Bases:
shuup.campaigns.models.catalog_filters.CatalogFilter
Parameters: - id (AutoField) – Id
- polymorphic_ctype (ForeignKey to
django.contrib.contenttypes.models.ContentType
) – Polymorphic ctype - active (BooleanField) – Active
- catalogfilter_ptr (OneToOneField to
shuup.campaigns.models.catalog_filters.CatalogFilter
) – Catalogfilter ptr - product_types (ManyToManyField to
shuup.core.models.ProductType
) – Product types
-
cached_shop_products
¶ ManyToOneRel to
shuup.campaigns.models.cache.CatalogFilterCachedShopProduct
Replace Django’s inheritance accessor member functions for our model (self.__class__) with our own versions. We monkey patch them until a patch can be added to Django (which would probably be very small and make all of this obsolete).
If we have inheritance of the form ModelA -> ModelB ->ModelC then Django creates accessors like this: - ModelA: modelb - ModelB: modela_ptr, modelb, modelc - ModelC: modela_ptr, modelb, modelb_ptr, modelc
These accessors allow Django (and everyone else) to travel up and down the inheritance tree for the db object at hand.
The original Django accessors use our polymorphic manager. But they should not. So we replace them with our own accessors that use our appropriate base_objects manager.
Parameters: - id (AutoField) – Id
- polymorphic_ctype (ForeignKey to
django.contrib.contenttypes.models.ContentType
) – Polymorphic ctype - active (BooleanField) – Active
- catalogfilter_ptr (OneToOneField to
shuup.campaigns.models.catalog_filters.CatalogFilter
) – Catalogfilter ptr - product_types (ManyToManyField to
shuup.core.models.ProductType
) – Product types
-
cached_shop_products
ManyToOneRel to
shuup.campaigns.models.cache.CatalogFilterCachedShopProduct
-
model
¶ alias of
ProductType
-
identifier
= 'product_type_filter'¶
-
name
= 'Product type'¶
-
product_types
¶ Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.
In the example:
class Pizza(Model): toppings = ManyToManyField(Topping, related_name='pizzas')
Pizza.toppings
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
-
description
¶
-
values
¶
-
exception
DoesNotExist
¶ Bases:
shuup.campaigns.models.catalog_filters.DoesNotExist
-
exception
MultipleObjectsReturned
¶ Bases:
shuup.campaigns.models.catalog_filters.MultipleObjectsReturned
-
catalogfilter_ptr
¶ Accessor to the related object on the forward side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Restaurant.place
is aForwardOneToOneDescriptor
instance.
-
catalogfilter_ptr_id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
polymorphic_primary_key_name
= 'id'¶
-
polymorphic_super_sub_accessors_replaced
= False¶
-
class
shuup.campaigns.models.catalog_filters.
ProductFilter
(id, polymorphic_ctype, active, catalogfilter_ptr)[source]¶ Bases:
shuup.campaigns.models.catalog_filters.CatalogFilter
Parameters: - id (AutoField) – Id
- polymorphic_ctype (ForeignKey to
django.contrib.contenttypes.models.ContentType
) – Polymorphic ctype - active (BooleanField) – Active
- catalogfilter_ptr (OneToOneField to
shuup.campaigns.models.catalog_filters.CatalogFilter
) – Catalogfilter ptr - products (ManyToManyField to
shuup.core.models.Product
) – Product
-
cached_shop_products
¶ ManyToOneRel to
shuup.campaigns.models.cache.CatalogFilterCachedShopProduct
Replace Django’s inheritance accessor member functions for our model (self.__class__) with our own versions. We monkey patch them until a patch can be added to Django (which would probably be very small and make all of this obsolete).
If we have inheritance of the form ModelA -> ModelB ->ModelC then Django creates accessors like this: - ModelA: modelb - ModelB: modela_ptr, modelb, modelc - ModelC: modela_ptr, modelb, modelb_ptr, modelc
These accessors allow Django (and everyone else) to travel up and down the inheritance tree for the db object at hand.
The original Django accessors use our polymorphic manager. But they should not. So we replace them with our own accessors that use our appropriate base_objects manager.
Parameters: - id (AutoField) – Id
- polymorphic_ctype (ForeignKey to
django.contrib.contenttypes.models.ContentType
) – Polymorphic ctype - active (BooleanField) – Active
- catalogfilter_ptr (OneToOneField to
shuup.campaigns.models.catalog_filters.CatalogFilter
) – Catalogfilter ptr - products (ManyToManyField to
shuup.core.models.Product
) – Product
-
cached_shop_products
ManyToOneRel to
shuup.campaigns.models.cache.CatalogFilterCachedShopProduct
-
model
¶ alias of
Product
-
identifier
= 'product_filter'¶
-
name
= 'Product'¶
-
products
¶ Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.
In the example:
class Pizza(Model): toppings = ManyToManyField(Topping, related_name='pizzas')
Pizza.toppings
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
-
description
¶
-
values
¶
-
exception
DoesNotExist
¶ Bases:
shuup.campaigns.models.catalog_filters.DoesNotExist
-
exception
MultipleObjectsReturned
¶ Bases:
shuup.campaigns.models.catalog_filters.MultipleObjectsReturned
-
catalogfilter_ptr
¶ Accessor to the related object on the forward side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Restaurant.place
is aForwardOneToOneDescriptor
instance.
-
catalogfilter_ptr_id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
polymorphic_primary_key_name
= 'id'¶
-
polymorphic_super_sub_accessors_replaced
= False¶
-
class
shuup.campaigns.models.catalog_filters.
CategoryFilter
(id, polymorphic_ctype, active, catalogfilter_ptr)[source]¶ Bases:
shuup.campaigns.models.catalog_filters.CatalogFilter
Parameters: - id (AutoField) – Id
- polymorphic_ctype (ForeignKey to
django.contrib.contenttypes.models.ContentType
) – Polymorphic ctype - active (BooleanField) – Active
- catalogfilter_ptr (OneToOneField to
shuup.campaigns.models.catalog_filters.CatalogFilter
) – Catalogfilter ptr - categories (ManyToManyField to
shuup.core.models.Category
) – Categories
-
cached_shop_products
¶ ManyToOneRel to
shuup.campaigns.models.cache.CatalogFilterCachedShopProduct
Replace Django’s inheritance accessor member functions for our model (self.__class__) with our own versions. We monkey patch them until a patch can be added to Django (which would probably be very small and make all of this obsolete).
If we have inheritance of the form ModelA -> ModelB ->ModelC then Django creates accessors like this: - ModelA: modelb - ModelB: modela_ptr, modelb, modelc - ModelC: modela_ptr, modelb, modelb_ptr, modelc
These accessors allow Django (and everyone else) to travel up and down the inheritance tree for the db object at hand.
The original Django accessors use our polymorphic manager. But they should not. So we replace them with our own accessors that use our appropriate base_objects manager.
Parameters: - id (AutoField) – Id
- polymorphic_ctype (ForeignKey to
django.contrib.contenttypes.models.ContentType
) – Polymorphic ctype - active (BooleanField) – Active
- catalogfilter_ptr (OneToOneField to
shuup.campaigns.models.catalog_filters.CatalogFilter
) – Catalogfilter ptr - categories (ManyToManyField to
shuup.core.models.Category
) – Categories
-
cached_shop_products
ManyToOneRel to
shuup.campaigns.models.cache.CatalogFilterCachedShopProduct
-
model
¶ alias of
Category
-
identifier
= 'category_filter'¶
-
name
= 'Product Category'¶
-
categories
¶ Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.
In the example:
class Pizza(Model): toppings = ManyToManyField(Topping, related_name='pizzas')
Pizza.toppings
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
-
exception
DoesNotExist
¶ Bases:
shuup.campaigns.models.catalog_filters.DoesNotExist
-
exception
MultipleObjectsReturned
¶ Bases:
shuup.campaigns.models.catalog_filters.MultipleObjectsReturned
-
catalogfilter_ptr
¶ Accessor to the related object on the forward side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Restaurant.place
is aForwardOneToOneDescriptor
instance.
-
catalogfilter_ptr_id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
description
¶
-
polymorphic_primary_key_name
= 'id'¶
-
polymorphic_super_sub_accessors_replaced
= False¶
-
values
¶
shuup.campaigns.models.contact_group_sales_ranges module¶
-
class
shuup.campaigns.models.contact_group_sales_ranges.
SalesRangeQuerySet
(model=None, query=None, using=None, hints=None)[source]¶ Bases:
django.db.models.query.QuerySet
-
class
shuup.campaigns.models.contact_group_sales_ranges.
ContactGroupSalesRange
(id, group, shop, min_value, max_value)[source]¶ Bases:
django.db.models.base.Model
Parameters: - id (AutoField) – Id
- group (ForeignKey to
shuup.core.models.ContactGroup
) – Group - shop (ForeignKey to
shuup.core.models.Shop
) – Shop - min_value (MoneyValueField) – Min amount
- max_value (MoneyValueField) – Max amount
-
group
¶ Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
-
shop
¶ Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
-
min_value
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
max_value
¶ 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.ManagerFromSalesRangeQuerySet object>¶
-
exception
DoesNotExist
¶ Bases:
django.core.exceptions.ObjectDoesNotExist
-
exception
MultipleObjectsReturned
¶ Bases:
django.core.exceptions.MultipleObjectsReturned
-
group_id
¶ 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.
-
shop_id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
shuup.campaigns.models.context_conditions module¶
-
class
shuup.campaigns.models.context_conditions.
ContextCondition
(id, polymorphic_ctype, active)[source]¶ Bases:
polymorphic.models.PolymorphicModel
Parameters: - id (AutoField) – Id
- polymorphic_ctype (ForeignKey to
django.contrib.contenttypes.models.ContentType
) – Polymorphic ctype - active (BooleanField) – Active
-
contactgroupcondition_set
¶ OneToOneRel to
shuup.campaigns.models.context_conditions.ContactGroupCondition
-
contactcondition_set
¶ OneToOneRel to
shuup.campaigns.models.context_conditions.ContactCondition
-
hourcondition_set
¶ OneToOneRel to
shuup.campaigns.models.context_conditions.HourCondition
Replace Django’s inheritance accessor member functions for our model (self.__class__) with our own versions. We monkey patch them until a patch can be added to Django (which would probably be very small and make all of this obsolete).
If we have inheritance of the form ModelA -> ModelB ->ModelC then Django creates accessors like this: - ModelA: modelb - ModelB: modela_ptr, modelb, modelc - ModelC: modela_ptr, modelb, modelb_ptr, modelc
These accessors allow Django (and everyone else) to travel up and down the inheritance tree for the db object at hand.
The original Django accessors use our polymorphic manager. But they should not. So we replace them with our own accessors that use our appropriate base_objects manager.
Parameters: - id (AutoField) – Id
- polymorphic_ctype (ForeignKey to
django.contrib.contenttypes.models.ContentType
) – Polymorphic ctype - active (BooleanField) – Active
-
contactgroupcondition_set
OneToOneRel to
shuup.campaigns.models.context_conditions.ContactGroupCondition
-
contactcondition_set
OneToOneRel to
shuup.campaigns.models.context_conditions.ContactCondition
-
hourcondition_set
OneToOneRel to
shuup.campaigns.models.context_conditions.HourCondition
-
model
= None¶
-
identifier
= 'context_condition'¶
-
name
= 'Context Condition'¶
-
description
= 'Context Condition'¶
-
active
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
exception
DoesNotExist
¶ Bases:
django.core.exceptions.ObjectDoesNotExist
-
exception
MultipleObjectsReturned
¶ Bases:
django.core.exceptions.MultipleObjectsReturned
-
campaign
¶ Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.
In the example:
class Pizza(Model): toppings = ManyToManyField(Topping, related_name='pizzas')
Pizza.toppings
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
-
contactcondition
¶ Accessor to the related object on the reverse side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Place.restaurant
is aReverseOneToOneDescriptor
instance.
-
contactgroupcondition
¶ Accessor to the related object on the reverse side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Place.restaurant
is aReverseOneToOneDescriptor
instance.
-
hourcondition
¶ Accessor to the related object on the reverse side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Place.restaurant
is aReverseOneToOneDescriptor
instance.
-
id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
polymorphic_ctype
¶ Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
-
polymorphic_primary_key_name
= 'id'¶
-
polymorphic_super_sub_accessors_replaced
= False¶
-
class
shuup.campaigns.models.context_conditions.
ContactGroupCondition
(id, polymorphic_ctype, active, contextcondition_ptr)[source]¶ Bases:
shuup.campaigns.models.context_conditions.ContextCondition
Parameters: - id (AutoField) – Id
- polymorphic_ctype (ForeignKey to
django.contrib.contenttypes.models.ContentType
) – Polymorphic ctype - active (BooleanField) – Active
- contextcondition_ptr (OneToOneField to
shuup.campaigns.models.context_conditions.ContextCondition
) – Contextcondition ptr - contact_groups (ManyToManyField to
shuup.core.models.ContactGroup
) – Contact groups
Replace Django’s inheritance accessor member functions for our model (self.__class__) with our own versions. We monkey patch them until a patch can be added to Django (which would probably be very small and make all of this obsolete).
If we have inheritance of the form ModelA -> ModelB ->ModelC then Django creates accessors like this: - ModelA: modelb - ModelB: modela_ptr, modelb, modelc - ModelC: modela_ptr, modelb, modelb_ptr, modelc
These accessors allow Django (and everyone else) to travel up and down the inheritance tree for the db object at hand.
The original Django accessors use our polymorphic manager. But they should not. So we replace them with our own accessors that use our appropriate base_objects manager.
Parameters: - id (AutoField) – Id
- polymorphic_ctype (ForeignKey to
django.contrib.contenttypes.models.ContentType
) – Polymorphic ctype - active (BooleanField) – Active
- contextcondition_ptr (OneToOneField to
shuup.campaigns.models.context_conditions.ContextCondition
) – Contextcondition ptr - contact_groups (ManyToManyField to
shuup.core.models.ContactGroup
) – Contact groups
-
model
¶ alias of
ContactGroup
-
identifier
= 'contact_group_condition'¶
-
name
= 'Contact Group'¶
-
contact_groups
¶ Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.
In the example:
class Pizza(Model): toppings = ManyToManyField(Topping, related_name='pizzas')
Pizza.toppings
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
-
description
¶
-
values
¶
-
exception
DoesNotExist
¶ Bases:
shuup.campaigns.models.context_conditions.DoesNotExist
-
exception
MultipleObjectsReturned
¶ Bases:
shuup.campaigns.models.context_conditions.MultipleObjectsReturned
-
contextcondition_ptr
¶ Accessor to the related object on the forward side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Restaurant.place
is aForwardOneToOneDescriptor
instance.
-
contextcondition_ptr_id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
polymorphic_primary_key_name
= 'id'¶
-
polymorphic_super_sub_accessors_replaced
= False¶
-
class
shuup.campaigns.models.context_conditions.
ContactCondition
(id, polymorphic_ctype, active, contextcondition_ptr)[source]¶ Bases:
shuup.campaigns.models.context_conditions.ContextCondition
Parameters: - id (AutoField) – Id
- polymorphic_ctype (ForeignKey to
django.contrib.contenttypes.models.ContentType
) – Polymorphic ctype - active (BooleanField) – Active
- contextcondition_ptr (OneToOneField to
shuup.campaigns.models.context_conditions.ContextCondition
) – Contextcondition ptr - contacts (ManyToManyField to
shuup.core.models.Contact
) – Contacts
Replace Django’s inheritance accessor member functions for our model (self.__class__) with our own versions. We monkey patch them until a patch can be added to Django (which would probably be very small and make all of this obsolete).
If we have inheritance of the form ModelA -> ModelB ->ModelC then Django creates accessors like this: - ModelA: modelb - ModelB: modela_ptr, modelb, modelc - ModelC: modela_ptr, modelb, modelb_ptr, modelc
These accessors allow Django (and everyone else) to travel up and down the inheritance tree for the db object at hand.
The original Django accessors use our polymorphic manager. But they should not. So we replace them with our own accessors that use our appropriate base_objects manager.
Parameters: - id (AutoField) – Id
- polymorphic_ctype (ForeignKey to
django.contrib.contenttypes.models.ContentType
) – Polymorphic ctype - active (BooleanField) – Active
- contextcondition_ptr (OneToOneField to
shuup.campaigns.models.context_conditions.ContextCondition
) – Contextcondition ptr - contacts (ManyToManyField to
shuup.core.models.Contact
) – Contacts
-
model
¶ alias of
Contact
-
identifier
= 'contact_condition'¶
-
name
= 'Contact'¶
-
contacts
¶ Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.
In the example:
class Pizza(Model): toppings = ManyToManyField(Topping, related_name='pizzas')
Pizza.toppings
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
-
description
¶
-
values
¶
-
exception
DoesNotExist
¶ Bases:
shuup.campaigns.models.context_conditions.DoesNotExist
-
exception
MultipleObjectsReturned
¶ Bases:
shuup.campaigns.models.context_conditions.MultipleObjectsReturned
-
contextcondition_ptr
¶ Accessor to the related object on the forward side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Restaurant.place
is aForwardOneToOneDescriptor
instance.
-
contextcondition_ptr_id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
polymorphic_primary_key_name
= 'id'¶
-
polymorphic_super_sub_accessors_replaced
= False¶
-
class
shuup.campaigns.models.context_conditions.
HourCondition
(id, polymorphic_ctype, active, contextcondition_ptr, hour_start, hour_end, days)[source]¶ Bases:
shuup.campaigns.models.context_conditions.ContextCondition
Parameters: - id (AutoField) – Id
- polymorphic_ctype (ForeignKey to
django.contrib.contenttypes.models.ContentType
) – Polymorphic ctype - active (BooleanField) – Active
- contextcondition_ptr (OneToOneField to
shuup.campaigns.models.context_conditions.ContextCondition
) – Contextcondition ptr - hour_start (TimeField) – 12pm is considered noon and 12am as midnight.
- hour_end (TimeField) – 12pm is considered noon and 12am as midnight. End time is not considered match.
- days (CharField) – Days
Replace Django’s inheritance accessor member functions for our model (self.__class__) with our own versions. We monkey patch them until a patch can be added to Django (which would probably be very small and make all of this obsolete).
If we have inheritance of the form ModelA -> ModelB ->ModelC then Django creates accessors like this: - ModelA: modelb - ModelB: modela_ptr, modelb, modelc - ModelC: modela_ptr, modelb, modelb_ptr, modelc
These accessors allow Django (and everyone else) to travel up and down the inheritance tree for the db object at hand.
The original Django accessors use our polymorphic manager. But they should not. So we replace them with our own accessors that use our appropriate base_objects manager.
Parameters: - id (AutoField) – Id
- polymorphic_ctype (ForeignKey to
django.contrib.contenttypes.models.ContentType
) – Polymorphic ctype - active (BooleanField) – Active
- contextcondition_ptr (OneToOneField to
shuup.campaigns.models.context_conditions.ContextCondition
) – Contextcondition ptr - hour_start (TimeField) – 12pm is considered noon and 12am as midnight.
- hour_end (TimeField) – 12pm is considered noon and 12am as midnight. End time is not considered match.
- days (CharField) – Days
-
identifier
= 'hour_condition'¶
-
name
= 'Day and hour'¶
-
hour_start
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
hour_end
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
days
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
exception
DoesNotExist
¶ Bases:
shuup.campaigns.models.context_conditions.DoesNotExist
-
exception
MultipleObjectsReturned
¶ Bases:
shuup.campaigns.models.context_conditions.MultipleObjectsReturned
-
contextcondition_ptr
¶ Accessor to the related object on the forward side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Restaurant.place
is aForwardOneToOneDescriptor
instance.
-
contextcondition_ptr_id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
description
¶
-
polymorphic_primary_key_name
= 'id'¶
-
polymorphic_super_sub_accessors_replaced
= False¶
-
values
¶
shuup.campaigns.models.matching module¶
shuup.campaigns.models.product_effects module¶
-
class
shuup.campaigns.models.product_effects.
ProductDiscountEffect
(id, polymorphic_ctype, campaign)[source]¶ Bases:
shuup.core.models.PolymorphicShuupModel
Parameters: - id (AutoField) – Id
- polymorphic_ctype (ForeignKey to
django.contrib.contenttypes.models.ContentType
) – Polymorphic ctype - campaign (ForeignKey to
shuup.campaigns.models.campaigns.CatalogCampaign
) – Campaign
-
productdiscountamount_set
¶ OneToOneRel to
shuup.campaigns.models.product_effects.ProductDiscountAmount
-
productdiscountpercentage_set
¶ OneToOneRel to
shuup.campaigns.models.product_effects.ProductDiscountPercentage
Replace Django’s inheritance accessor member functions for our model (self.__class__) with our own versions. We monkey patch them until a patch can be added to Django (which would probably be very small and make all of this obsolete).
If we have inheritance of the form ModelA -> ModelB ->ModelC then Django creates accessors like this: - ModelA: modelb - ModelB: modela_ptr, modelb, modelc - ModelC: modela_ptr, modelb, modelb_ptr, modelc
These accessors allow Django (and everyone else) to travel up and down the inheritance tree for the db object at hand.
The original Django accessors use our polymorphic manager. But they should not. So we replace them with our own accessors that use our appropriate base_objects manager.
Parameters: - id (AutoField) – Id
- polymorphic_ctype (ForeignKey to
django.contrib.contenttypes.models.ContentType
) – Polymorphic ctype - campaign (ForeignKey to
shuup.campaigns.models.campaigns.CatalogCampaign
) – Campaign
-
productdiscountamount_set
OneToOneRel to
shuup.campaigns.models.product_effects.ProductDiscountAmount
-
productdiscountpercentage_set
OneToOneRel to
shuup.campaigns.models.product_effects.ProductDiscountPercentage
-
identifier
= None¶
-
model
= None¶
-
admin_form_class
= None¶
-
campaign
¶ Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
-
apply_for_product
(context, product, price_info)[source]¶ Applies the effect for product
Returns: amount of discount to accumulate for the product Return type: Price
-
exception
DoesNotExist
¶ Bases:
django.core.exceptions.ObjectDoesNotExist
-
exception
MultipleObjectsReturned
¶ Bases:
django.core.exceptions.MultipleObjectsReturned
-
campaign_id
¶ 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.
-
polymorphic_ctype
¶ Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
-
polymorphic_primary_key_name
= 'id'¶
-
polymorphic_super_sub_accessors_replaced
= False¶
-
productdiscountamount
¶ Accessor to the related object on the reverse side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Place.restaurant
is aReverseOneToOneDescriptor
instance.
-
productdiscountpercentage
¶ Accessor to the related object on the reverse side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Place.restaurant
is aReverseOneToOneDescriptor
instance.
-
class
shuup.campaigns.models.product_effects.
ProductDiscountAmount
(id, polymorphic_ctype, campaign, productdiscounteffect_ptr, discount_amount)[source]¶ Bases:
shuup.campaigns.models.product_effects.ProductDiscountEffect
Parameters: - id (AutoField) – Id
- polymorphic_ctype (ForeignKey to
django.contrib.contenttypes.models.ContentType
) – Polymorphic ctype - campaign (ForeignKey to
shuup.campaigns.models.campaigns.CatalogCampaign
) – Campaign - productdiscounteffect_ptr (OneToOneField to
shuup.campaigns.models.product_effects.ProductDiscountEffect
) – Productdiscounteffect ptr - discount_amount (MoneyValueField) – Flat amount of discount.
Replace Django’s inheritance accessor member functions for our model (self.__class__) with our own versions. We monkey patch them until a patch can be added to Django (which would probably be very small and make all of this obsolete).
If we have inheritance of the form ModelA -> ModelB ->ModelC then Django creates accessors like this: - ModelA: modelb - ModelB: modela_ptr, modelb, modelc - ModelC: modela_ptr, modelb, modelb_ptr, modelc
These accessors allow Django (and everyone else) to travel up and down the inheritance tree for the db object at hand.
The original Django accessors use our polymorphic manager. But they should not. So we replace them with our own accessors that use our appropriate base_objects manager.
Parameters: - id (AutoField) – Id
- polymorphic_ctype (ForeignKey to
django.contrib.contenttypes.models.ContentType
) – Polymorphic ctype - campaign (ForeignKey to
shuup.campaigns.models.campaigns.CatalogCampaign
) – Campaign - productdiscounteffect_ptr (OneToOneField to
shuup.campaigns.models.product_effects.ProductDiscountEffect
) – Productdiscounteffect ptr - discount_amount (MoneyValueField) – Flat amount of discount.
-
identifier
= 'discount_amount_effect'¶
-
name
= 'Discount amount value'¶
-
discount_amount
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
description
¶
-
value
¶
-
exception
DoesNotExist
¶ Bases:
shuup.campaigns.models.product_effects.DoesNotExist
-
exception
MultipleObjectsReturned
¶ Bases:
shuup.campaigns.models.product_effects.MultipleObjectsReturned
-
polymorphic_primary_key_name
= 'id'¶
-
polymorphic_super_sub_accessors_replaced
= False¶
-
productdiscounteffect_ptr
¶ Accessor to the related object on the forward side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Restaurant.place
is aForwardOneToOneDescriptor
instance.
-
productdiscounteffect_ptr_id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
class
shuup.campaigns.models.product_effects.
ProductDiscountPercentage
(id, polymorphic_ctype, campaign, productdiscounteffect_ptr, discount_percentage)[source]¶ Bases:
shuup.campaigns.models.product_effects.ProductDiscountEffect
Parameters: - id (AutoField) – Id
- polymorphic_ctype (ForeignKey to
django.contrib.contenttypes.models.ContentType
) – Polymorphic ctype - campaign (ForeignKey to
shuup.campaigns.models.campaigns.CatalogCampaign
) – Campaign - productdiscounteffect_ptr (OneToOneField to
shuup.campaigns.models.product_effects.ProductDiscountEffect
) – Productdiscounteffect ptr - discount_percentage (DecimalField) – The discount percentage for this campaign.
Replace Django’s inheritance accessor member functions for our model (self.__class__) with our own versions. We monkey patch them until a patch can be added to Django (which would probably be very small and make all of this obsolete).
If we have inheritance of the form ModelA -> ModelB ->ModelC then Django creates accessors like this: - ModelA: modelb - ModelB: modela_ptr, modelb, modelc - ModelC: modela_ptr, modelb, modelb_ptr, modelc
These accessors allow Django (and everyone else) to travel up and down the inheritance tree for the db object at hand.
The original Django accessors use our polymorphic manager. But they should not. So we replace them with our own accessors that use our appropriate base_objects manager.
Parameters: - id (AutoField) – Id
- polymorphic_ctype (ForeignKey to
django.contrib.contenttypes.models.ContentType
) – Polymorphic ctype - campaign (ForeignKey to
shuup.campaigns.models.campaigns.CatalogCampaign
) – Campaign - productdiscounteffect_ptr (OneToOneField to
shuup.campaigns.models.product_effects.ProductDiscountEffect
) – Productdiscounteffect ptr - discount_percentage (DecimalField) – The discount percentage for this campaign.
-
identifier
= 'discount_percentage_effect'¶
-
name
= 'Discount amount percentage'¶
-
admin_form_class
¶ alias of
PercentageField
-
discount_percentage
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
description
¶
-
exception
DoesNotExist
¶ Bases:
shuup.campaigns.models.product_effects.DoesNotExist
-
exception
MultipleObjectsReturned
¶ Bases:
shuup.campaigns.models.product_effects.MultipleObjectsReturned
-
polymorphic_primary_key_name
= 'id'¶
-
polymorphic_super_sub_accessors_replaced
= False¶
-
productdiscounteffect_ptr
¶ Accessor to the related object on the forward side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Restaurant.place
is aForwardOneToOneDescriptor
instance.
-
productdiscounteffect_ptr_id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
value
¶
Module contents¶
-
class
shuup.campaigns.models.
BasketLineEffect
(id, polymorphic_ctype, campaign)[source]¶ Bases:
shuup.core.models.PolymorphicShuupModel
Parameters: - id (AutoField) – Id
- polymorphic_ctype (ForeignKey to
django.contrib.contenttypes.models.ContentType
) – Polymorphic ctype - campaign (ForeignKey to
shuup.campaigns.models.campaigns.BasketCampaign
) – Campaign
-
freeproductline_set
¶ OneToOneRel to
shuup.campaigns.models.basket_line_effects.FreeProductLine
-
discountfromproduct_set
¶ OneToOneRel to
shuup.campaigns.models.basket_line_effects.DiscountFromProduct
-
discountfromcategoryproducts_set
¶ OneToOneRel to
shuup.campaigns.models.basket_line_effects.DiscountFromCategoryProducts
Replace Django’s inheritance accessor member functions for our model (self.__class__) with our own versions. We monkey patch them until a patch can be added to Django (which would probably be very small and make all of this obsolete).
If we have inheritance of the form ModelA -> ModelB ->ModelC then Django creates accessors like this: - ModelA: modelb - ModelB: modela_ptr, modelb, modelc - ModelC: modela_ptr, modelb, modelb_ptr, modelc
These accessors allow Django (and everyone else) to travel up and down the inheritance tree for the db object at hand.
The original Django accessors use our polymorphic manager. But they should not. So we replace them with our own accessors that use our appropriate base_objects manager.
Parameters: - id (AutoField) – Id
- polymorphic_ctype (ForeignKey to
django.contrib.contenttypes.models.ContentType
) – Polymorphic ctype - campaign (ForeignKey to
shuup.campaigns.models.campaigns.BasketCampaign
) – Campaign
-
freeproductline_set
OneToOneRel to
shuup.campaigns.models.basket_line_effects.FreeProductLine
-
discountfromproduct_set
OneToOneRel to
shuup.campaigns.models.basket_line_effects.DiscountFromProduct
-
discountfromcategoryproducts_set
OneToOneRel to
shuup.campaigns.models.basket_line_effects.DiscountFromCategoryProducts
-
exception
DoesNotExist
¶ Bases:
django.core.exceptions.ObjectDoesNotExist
-
exception
MultipleObjectsReturned
¶ Bases:
django.core.exceptions.MultipleObjectsReturned
-
admin_form_class
= None¶
-
campaign
¶ Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
-
campaign_id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
discountfromcategoryproducts
¶ Accessor to the related object on the reverse side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Place.restaurant
is aReverseOneToOneDescriptor
instance.
-
discountfromproduct
¶ Accessor to the related object on the reverse side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Place.restaurant
is aReverseOneToOneDescriptor
instance.
-
freeproductline
¶ Accessor to the related object on the reverse side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Place.restaurant
is aReverseOneToOneDescriptor
instance.
-
get_discount_lines
(order_source, original_lines, supplier)[source]¶ Applies the effect based on given
order_source
Returns: amount of discount to accumulate for the product Return type: Iterable[shuup.core.order_creator.SourceLine]
-
id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
identifier
= None¶
-
model
= None¶
-
polymorphic_ctype
¶ Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
-
polymorphic_primary_key_name
= 'id'¶
-
polymorphic_super_sub_accessors_replaced
= False¶
-
class
shuup.campaigns.models.
BasketCampaign
(id, shop, name, identifier, active, start_datetime, end_datetime, created_by, modified_by, created_on, modified_on, basket_line_text, coupon, supplier)[source]¶ Bases:
shuup.campaigns.models.campaigns.Campaign
Parameters: - id (AutoField) – Id
- shop (ForeignKey to
shuup.core.models.Shop
) – The shop where the campaign is active. - name (CharField) – The name for this campaign.
- identifier (InternalIdentifierField) – Do not change this value if you are not sure what you are doing.
- active (BooleanField) – Enable this if the campaign is currently active. Please also set a start and an end date.
- start_datetime (DateTimeField) – The date and time the campaign starts. This is only applicable if the campaign is marked as active.
- end_datetime (DateTimeField) – The date and time the campaign ends. This is only applicable if the campaign is marked as active.
- created_by (ForeignKey to
django.contrib.auth.models.User
) – Created by - modified_by (ForeignKey to
django.contrib.auth.models.User
) – Modified by - created_on (DateTimeField) – Created on
- modified_on (DateTimeField) – Modified on
- basket_line_text (CharField) – This text will be shown in a basket.
- coupon (OneToOneField to
shuup.campaigns.models.campaigns.Coupon
) – Coupon - supplier (ForeignKey to
shuup.core.models.Supplier
) – When set, this campaign will match only products from the selected supplier. Rules and Effects will also be restricted to include only the products of this supplier. - conditions (ManyToManyField to
shuup.campaigns.models.basket_conditions.BasketCondition
) – Conditions - public_name (CharField) – (Translatable) The campaign name to show in the store front.
-
discount_effects
¶ ManyToOneRel to
shuup.campaigns.models.basket_effects.BasketDiscountEffect
-
line_effects
¶ ManyToOneRel to
shuup.campaigns.models.basket_line_effects.BasketLineEffect
-
translations
¶ ManyToOneRel to
shuup.campaigns.models.campaigns.BasketCampaignTranslation
-
log_entries
¶ ManyToOneRel to
shuup.campaigns.models.campaigns.BasketCampaignLogEntry
-
exception
DoesNotExist
¶ Bases:
django.core.exceptions.ObjectDoesNotExist
-
exception
MultipleObjectsReturned
¶ Bases:
django.core.exceptions.MultipleObjectsReturned
-
add_log_entry
(message, identifier=None, kind=<LogEntryKind.OTHER: 0>, user=None, extra=None, save=True)¶
-
admin_url_suffix
= 'basket_campaign'¶
-
basket_line_text
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
conditions
¶ Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.
In the example:
class Pizza(Model): toppings = ManyToManyField(Topping, related_name='pizzas')
Pizza.toppings
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
-
coupon
¶ Accessor to the related object on the forward side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Restaurant.place
is aForwardOneToOneDescriptor
instance.
-
coupon_id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
created_by
¶ Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
-
discount_effects
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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
-
get_next_by_created_on
(*, field=<django.db.models.fields.DateTimeField: created_on>, is_next=True, **kwargs)¶
-
get_next_by_modified_on
(*, field=<django.db.models.fields.DateTimeField: modified_on>, is_next=True, **kwargs)¶
-
get_previous_by_created_on
(*, field=<django.db.models.fields.DateTimeField: created_on>, is_next=False, **kwargs)¶
-
get_previous_by_modified_on
(*, field=<django.db.models.fields.DateTimeField: modified_on>, is_next=False, **kwargs)¶
-
id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
line_effects
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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
-
log_entries
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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
-
modified_by
¶ Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
-
public_name
¶ Descriptor for translated attributes.
This attribute proxies all get/set calls to the translated model.
-
rules_match
(basket, lines)[source]¶ Check if basket rules match.
They will not match if: 1) The campaign is not active 2) The campaign has attached coupon,
which doesn’t match or is not active- Any of the attached rules don’t match
-
shop
¶ Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
-
supplier
¶ Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
-
supplier_id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
translations
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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
-
class
shuup.campaigns.models.
BasketDiscountEffect
(id, polymorphic_ctype, campaign)[source]¶ Bases:
shuup.core.models.PolymorphicShuupModel
Parameters: - id (AutoField) – Id
- polymorphic_ctype (ForeignKey to
django.contrib.contenttypes.models.ContentType
) – Polymorphic ctype - campaign (ForeignKey to
shuup.campaigns.models.campaigns.BasketCampaign
) – Campaign
-
basketdiscountamount_set
¶ OneToOneRel to
shuup.campaigns.models.basket_effects.BasketDiscountAmount
-
basketdiscountpercentage_set
¶ OneToOneRel to
shuup.campaigns.models.basket_effects.BasketDiscountPercentage
-
discountpercentagefromundiscounted_set
¶ OneToOneRel to
shuup.campaigns.models.basket_effects.DiscountPercentageFromUndiscounted
Replace Django’s inheritance accessor member functions for our model (self.__class__) with our own versions. We monkey patch them until a patch can be added to Django (which would probably be very small and make all of this obsolete).
If we have inheritance of the form ModelA -> ModelB ->ModelC then Django creates accessors like this: - ModelA: modelb - ModelB: modela_ptr, modelb, modelc - ModelC: modela_ptr, modelb, modelb_ptr, modelc
These accessors allow Django (and everyone else) to travel up and down the inheritance tree for the db object at hand.
The original Django accessors use our polymorphic manager. But they should not. So we replace them with our own accessors that use our appropriate base_objects manager.
Parameters: - id (AutoField) – Id
- polymorphic_ctype (ForeignKey to
django.contrib.contenttypes.models.ContentType
) – Polymorphic ctype - campaign (ForeignKey to
shuup.campaigns.models.campaigns.BasketCampaign
) – Campaign
-
basketdiscountamount_set
OneToOneRel to
shuup.campaigns.models.basket_effects.BasketDiscountAmount
-
basketdiscountpercentage_set
OneToOneRel to
shuup.campaigns.models.basket_effects.BasketDiscountPercentage
-
discountpercentagefromundiscounted_set
OneToOneRel to
shuup.campaigns.models.basket_effects.DiscountPercentageFromUndiscounted
-
exception
DoesNotExist
¶ Bases:
django.core.exceptions.ObjectDoesNotExist
-
exception
MultipleObjectsReturned
¶ Bases:
django.core.exceptions.MultipleObjectsReturned
-
admin_form_class
= None¶
-
apply_for_basket
(order_source)[source]¶ Applies the effect based on given
order_source
Returns: amount of discount to accumulate for the product Return type: Price
-
basketdiscountamount
¶ Accessor to the related object on the reverse side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Place.restaurant
is aReverseOneToOneDescriptor
instance.
-
basketdiscountpercentage
¶ Accessor to the related object on the reverse side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Place.restaurant
is aReverseOneToOneDescriptor
instance.
-
campaign
¶ Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
-
campaign_id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
discountpercentagefromundiscounted
¶ Accessor to the related object on the reverse side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Place.restaurant
is aReverseOneToOneDescriptor
instance.
-
id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
identifier
= None¶
-
model
= None¶
-
polymorphic_ctype
¶ Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
-
polymorphic_primary_key_name
= 'id'¶
-
polymorphic_super_sub_accessors_replaced
= False¶
-
class
shuup.campaigns.models.
BasketCondition
(id, polymorphic_ctype, active)[source]¶ Bases:
polymorphic.models.PolymorphicModel
Parameters: - id (AutoField) – Id
- polymorphic_ctype (ForeignKey to
django.contrib.contenttypes.models.ContentType
) – Polymorphic ctype - active (BooleanField) – Active
-
baskettotalproductamountcondition_set
¶ OneToOneRel to
shuup.campaigns.models.basket_conditions.BasketTotalProductAmountCondition
-
baskettotalamountcondition_set
¶ OneToOneRel to
shuup.campaigns.models.basket_conditions.BasketTotalAmountCondition
-
baskettotalundiscountedproductamountcondition_set
¶ OneToOneRel to
shuup.campaigns.models.basket_conditions.BasketTotalUndiscountedProductAmountCondition
-
basketmaxtotalproductamountcondition_set
¶ OneToOneRel to
shuup.campaigns.models.basket_conditions.BasketMaxTotalProductAmountCondition
-
basketmaxtotalamountcondition_set
¶ OneToOneRel to
shuup.campaigns.models.basket_conditions.BasketMaxTotalAmountCondition
-
productsinbasketcondition_set
¶ OneToOneRel to
shuup.campaigns.models.basket_conditions.ProductsInBasketCondition
-
contactgroupbasketcondition_set
¶ OneToOneRel to
shuup.campaigns.models.basket_conditions.ContactGroupBasketCondition
-
contactbasketcondition_set
¶ OneToOneRel to
shuup.campaigns.models.basket_conditions.ContactBasketCondition
-
categoryproductsbasketcondition_set
¶ OneToOneRel to
shuup.campaigns.models.basket_conditions.CategoryProductsBasketCondition
-
hourbasketcondition_set
¶ OneToOneRel to
shuup.campaigns.models.basket_conditions.HourBasketCondition
-
childrenproductcondition_set
¶ OneToOneRel to
shuup.campaigns.models.basket_conditions.ChildrenProductCondition
Replace Django’s inheritance accessor member functions for our model (self.__class__) with our own versions. We monkey patch them until a patch can be added to Django (which would probably be very small and make all of this obsolete).
If we have inheritance of the form ModelA -> ModelB ->ModelC then Django creates accessors like this: - ModelA: modelb - ModelB: modela_ptr, modelb, modelc - ModelC: modela_ptr, modelb, modelb_ptr, modelc
These accessors allow Django (and everyone else) to travel up and down the inheritance tree for the db object at hand.
The original Django accessors use our polymorphic manager. But they should not. So we replace them with our own accessors that use our appropriate base_objects manager.
Parameters: - id (AutoField) – Id
- polymorphic_ctype (ForeignKey to
django.contrib.contenttypes.models.ContentType
) – Polymorphic ctype - active (BooleanField) – Active
-
baskettotalproductamountcondition_set
OneToOneRel to
shuup.campaigns.models.basket_conditions.BasketTotalProductAmountCondition
-
baskettotalamountcondition_set
OneToOneRel to
shuup.campaigns.models.basket_conditions.BasketTotalAmountCondition
-
baskettotalundiscountedproductamountcondition_set
OneToOneRel to
shuup.campaigns.models.basket_conditions.BasketTotalUndiscountedProductAmountCondition
-
basketmaxtotalproductamountcondition_set
OneToOneRel to
shuup.campaigns.models.basket_conditions.BasketMaxTotalProductAmountCondition
-
basketmaxtotalamountcondition_set
OneToOneRel to
shuup.campaigns.models.basket_conditions.BasketMaxTotalAmountCondition
-
productsinbasketcondition_set
OneToOneRel to
shuup.campaigns.models.basket_conditions.ProductsInBasketCondition
-
contactgroupbasketcondition_set
OneToOneRel to
shuup.campaigns.models.basket_conditions.ContactGroupBasketCondition
-
contactbasketcondition_set
OneToOneRel to
shuup.campaigns.models.basket_conditions.ContactBasketCondition
-
categoryproductsbasketcondition_set
OneToOneRel to
shuup.campaigns.models.basket_conditions.CategoryProductsBasketCondition
-
hourbasketcondition_set
OneToOneRel to
shuup.campaigns.models.basket_conditions.HourBasketCondition
-
childrenproductcondition_set
OneToOneRel to
shuup.campaigns.models.basket_conditions.ChildrenProductCondition
-
exception
DoesNotExist
¶ Bases:
django.core.exceptions.ObjectDoesNotExist
-
exception
MultipleObjectsReturned
¶ Bases:
django.core.exceptions.MultipleObjectsReturned
-
active
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
basketmaxtotalamountcondition
¶ Accessor to the related object on the reverse side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Place.restaurant
is aReverseOneToOneDescriptor
instance.
-
basketmaxtotalproductamountcondition
¶ Accessor to the related object on the reverse side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Place.restaurant
is aReverseOneToOneDescriptor
instance.
-
baskettotalamountcondition
¶ Accessor to the related object on the reverse side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Place.restaurant
is aReverseOneToOneDescriptor
instance.
-
baskettotalproductamountcondition
¶ Accessor to the related object on the reverse side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Place.restaurant
is aReverseOneToOneDescriptor
instance.
-
baskettotalundiscountedproductamountcondition
¶ Accessor to the related object on the reverse side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Place.restaurant
is aReverseOneToOneDescriptor
instance.
-
campaign
¶ Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.
In the example:
class Pizza(Model): toppings = ManyToManyField(Topping, related_name='pizzas')
Pizza.toppings
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
-
categoryproductsbasketcondition
¶ Accessor to the related object on the reverse side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Place.restaurant
is aReverseOneToOneDescriptor
instance.
-
childrenproductcondition
¶ Accessor to the related object on the reverse side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Place.restaurant
is aReverseOneToOneDescriptor
instance.
-
contactbasketcondition
¶ Accessor to the related object on the reverse side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Place.restaurant
is aReverseOneToOneDescriptor
instance.
-
contactgroupbasketcondition
¶ Accessor to the related object on the reverse side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Place.restaurant
is aReverseOneToOneDescriptor
instance.
-
hourbasketcondition
¶ Accessor to the related object on the reverse side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Place.restaurant
is aReverseOneToOneDescriptor
instance.
-
id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
model
= None¶
-
name
= 'Basket condition'¶
-
polymorphic_ctype
¶ Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
-
polymorphic_primary_key_name
= 'id'¶
-
polymorphic_super_sub_accessors_replaced
= False¶
-
productsinbasketcondition
¶ Accessor to the related object on the reverse side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Place.restaurant
is aReverseOneToOneDescriptor
instance.
-
class
shuup.campaigns.models.
Campaign
(*args, **kwargs)[source]¶ Bases:
shuup.utils.properties.MoneyPropped
,parler.models.TranslatableModel
Parameters: - shop (ForeignKey to
shuup.core.models.Shop
) – The shop where the campaign is active. - name (CharField) – The name for this campaign.
- identifier (InternalIdentifierField) – Do not change this value if you are not sure what you are doing.
- active (BooleanField) – Enable this if the campaign is currently active. Please also set a start and an end date.
- start_datetime (DateTimeField) – The date and time the campaign starts. This is only applicable if the campaign is marked as active.
- end_datetime (DateTimeField) – The date and time the campaign ends. This is only applicable if the campaign is marked as active.
- created_by (ForeignKey to
django.contrib.auth.models.User
) – Created by - modified_by (ForeignKey to
django.contrib.auth.models.User
) – Modified by - created_on (DateTimeField) – Created on
- modified_on (DateTimeField) – Modified on
-
class
Meta
[source]¶ Bases:
object
-
abstract
= False¶
-
verbose_name
= 'Campaign'¶
-
verbose_name_plural
= 'Campaigns'¶
-
-
active
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
admin_url_suffix
= None¶
-
created_by
¶ Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
-
created_by_id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
created_on
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
end_datetime
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
get_next_by_created_on
(*, field=<django.db.models.fields.DateTimeField: created_on>, is_next=True, **kwargs)¶
-
get_next_by_modified_on
(*, field=<django.db.models.fields.DateTimeField: modified_on>, is_next=True, **kwargs)¶
-
get_previous_by_created_on
(*, field=<django.db.models.fields.DateTimeField: created_on>, is_next=False, **kwargs)¶
-
get_previous_by_modified_on
(*, field=<django.db.models.fields.DateTimeField: modified_on>, is_next=False, **kwargs)¶
-
identifier
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
modified_by
¶ Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
-
modified_by_id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
modified_on
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
name
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
objects
¶
-
shop
¶ Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
-
shop_id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
start_datetime
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
type
¶
- shop (ForeignKey to
-
class
shuup.campaigns.models.
ProductDiscountEffect
(id, polymorphic_ctype, campaign)[source]¶ Bases:
shuup.core.models.PolymorphicShuupModel
Parameters: - id (AutoField) – Id
- polymorphic_ctype (ForeignKey to
django.contrib.contenttypes.models.ContentType
) – Polymorphic ctype - campaign (ForeignKey to
shuup.campaigns.models.campaigns.CatalogCampaign
) – Campaign
-
productdiscountamount_set
¶ OneToOneRel to
shuup.campaigns.models.product_effects.ProductDiscountAmount
-
productdiscountpercentage_set
¶ OneToOneRel to
shuup.campaigns.models.product_effects.ProductDiscountPercentage
Replace Django’s inheritance accessor member functions for our model (self.__class__) with our own versions. We monkey patch them until a patch can be added to Django (which would probably be very small and make all of this obsolete).
If we have inheritance of the form ModelA -> ModelB ->ModelC then Django creates accessors like this: - ModelA: modelb - ModelB: modela_ptr, modelb, modelc - ModelC: modela_ptr, modelb, modelb_ptr, modelc
These accessors allow Django (and everyone else) to travel up and down the inheritance tree for the db object at hand.
The original Django accessors use our polymorphic manager. But they should not. So we replace them with our own accessors that use our appropriate base_objects manager.
Parameters: - id (AutoField) – Id
- polymorphic_ctype (ForeignKey to
django.contrib.contenttypes.models.ContentType
) – Polymorphic ctype - campaign (ForeignKey to
shuup.campaigns.models.campaigns.CatalogCampaign
) – Campaign
-
productdiscountamount_set
OneToOneRel to
shuup.campaigns.models.product_effects.ProductDiscountAmount
-
productdiscountpercentage_set
OneToOneRel to
shuup.campaigns.models.product_effects.ProductDiscountPercentage
-
exception
DoesNotExist
¶ Bases:
django.core.exceptions.ObjectDoesNotExist
-
exception
MultipleObjectsReturned
¶ Bases:
django.core.exceptions.MultipleObjectsReturned
-
admin_form_class
= None¶
-
apply_for_product
(context, product, price_info)[source]¶ Applies the effect for product
Returns: amount of discount to accumulate for the product Return type: Price
-
campaign
¶ Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
-
campaign_id
¶ 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.
-
identifier
= None¶
-
model
= None¶
-
polymorphic_ctype
¶ Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
-
polymorphic_primary_key_name
= 'id'¶
-
polymorphic_super_sub_accessors_replaced
= False¶
-
productdiscountamount
¶ Accessor to the related object on the reverse side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Place.restaurant
is aReverseOneToOneDescriptor
instance.
-
productdiscountpercentage
¶ Accessor to the related object on the reverse side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Place.restaurant
is aReverseOneToOneDescriptor
instance.
-
class
shuup.campaigns.models.
CatalogCampaign
(id, shop, name, identifier, active, start_datetime, end_datetime, created_by, modified_by, created_on, modified_on)[source]¶ Bases:
shuup.campaigns.models.campaigns.Campaign
Parameters: - id (AutoField) – Id
- shop (ForeignKey to
shuup.core.models.Shop
) – The shop where the campaign is active. - name (CharField) – The name for this campaign.
- identifier (InternalIdentifierField) – Do not change this value if you are not sure what you are doing.
- active (BooleanField) – Enable this if the campaign is currently active. Please also set a start and an end date.
- start_datetime (DateTimeField) – The date and time the campaign starts. This is only applicable if the campaign is marked as active.
- end_datetime (DateTimeField) – The date and time the campaign ends. This is only applicable if the campaign is marked as active.
- created_by (ForeignKey to
django.contrib.auth.models.User
) – Created by - modified_by (ForeignKey to
django.contrib.auth.models.User
) – Modified by - created_on (DateTimeField) – Created on
- modified_on (DateTimeField) – Modified on
- conditions (ManyToManyField to
shuup.campaigns.models.context_conditions.ContextCondition
) – Conditions - filters (ManyToManyField to
shuup.campaigns.models.catalog_filters.CatalogFilter
) – Filters - public_name (CharField) – (Translatable) The campaign name to show in the store front.
-
translations
¶ ManyToOneRel to
shuup.campaigns.models.campaigns.CatalogCampaignTranslation
-
log_entries
¶ ManyToOneRel to
shuup.campaigns.models.campaigns.CatalogCampaignLogEntry
-
effects
¶ ManyToOneRel to
shuup.campaigns.models.product_effects.ProductDiscountEffect
-
exception
DoesNotExist
¶ Bases:
django.core.exceptions.ObjectDoesNotExist
-
exception
MultipleObjectsReturned
¶ Bases:
django.core.exceptions.MultipleObjectsReturned
-
add_log_entry
(message, identifier=None, kind=<LogEntryKind.OTHER: 0>, user=None, extra=None, save=True)¶
-
admin_url_suffix
= 'catalog_campaign'¶
-
conditions
¶ Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.
In the example:
class Pizza(Model): toppings = ManyToManyField(Topping, related_name='pizzas')
Pizza.toppings
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
-
created_by
¶ Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
-
effects
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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
-
filters
¶ Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.
In the example:
class Pizza(Model): toppings = ManyToManyField(Topping, related_name='pizzas')
Pizza.toppings
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
-
get_next_by_created_on
(*, field=<django.db.models.fields.DateTimeField: created_on>, is_next=True, **kwargs)¶
-
get_next_by_modified_on
(*, field=<django.db.models.fields.DateTimeField: modified_on>, is_next=True, **kwargs)¶
-
get_previous_by_created_on
(*, field=<django.db.models.fields.DateTimeField: created_on>, is_next=False, **kwargs)¶
-
get_previous_by_modified_on
(*, field=<django.db.models.fields.DateTimeField: modified_on>, is_next=False, **kwargs)¶
-
id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
log_entries
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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
-
modified_by
¶ Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
-
public_name
¶ Descriptor for translated attributes.
This attribute proxies all get/set calls to the translated model.
-
shop
¶ Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
-
translations
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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
-
class
shuup.campaigns.models.
CatalogFilter
(id, polymorphic_ctype, active)[source]¶ Bases:
polymorphic.models.PolymorphicModel
Parameters: - id (AutoField) – Id
- polymorphic_ctype (ForeignKey to
django.contrib.contenttypes.models.ContentType
) – Polymorphic ctype - active (BooleanField) – Active
-
cached_shop_products
¶ ManyToOneRel to
shuup.campaigns.models.cache.CatalogFilterCachedShopProduct
-
producttypefilter_set
¶ OneToOneRel to
shuup.campaigns.models.catalog_filters.ProductTypeFilter
-
productfilter_set
¶ OneToOneRel to
shuup.campaigns.models.catalog_filters.ProductFilter
-
categoryfilter_set
¶ OneToOneRel to
shuup.campaigns.models.catalog_filters.CategoryFilter
Replace Django’s inheritance accessor member functions for our model (self.__class__) with our own versions. We monkey patch them until a patch can be added to Django (which would probably be very small and make all of this obsolete).
If we have inheritance of the form ModelA -> ModelB ->ModelC then Django creates accessors like this: - ModelA: modelb - ModelB: modela_ptr, modelb, modelc - ModelC: modela_ptr, modelb, modelb_ptr, modelc
These accessors allow Django (and everyone else) to travel up and down the inheritance tree for the db object at hand.
The original Django accessors use our polymorphic manager. But they should not. So we replace them with our own accessors that use our appropriate base_objects manager.
Parameters: - id (AutoField) – Id
- polymorphic_ctype (ForeignKey to
django.contrib.contenttypes.models.ContentType
) – Polymorphic ctype - active (BooleanField) – Active
-
cached_shop_products
ManyToOneRel to
shuup.campaigns.models.cache.CatalogFilterCachedShopProduct
-
producttypefilter_set
OneToOneRel to
shuup.campaigns.models.catalog_filters.ProductTypeFilter
-
productfilter_set
OneToOneRel to
shuup.campaigns.models.catalog_filters.ProductFilter
-
categoryfilter_set
OneToOneRel to
shuup.campaigns.models.catalog_filters.CategoryFilter
-
exception
DoesNotExist
¶ Bases:
django.core.exceptions.ObjectDoesNotExist
-
exception
MultipleObjectsReturned
¶ Bases:
django.core.exceptions.MultipleObjectsReturned
-
active
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
cached_shop_products
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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
-
campaign
¶ Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.
In the example:
class Pizza(Model): toppings = ManyToManyField(Topping, related_name='pizzas')
Pizza.toppings
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
-
categoryfilter
¶ Accessor to the related object on the reverse side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Place.restaurant
is aReverseOneToOneDescriptor
instance.
-
id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
identifier
= 'base_catalog_filter'¶
-
model
= None¶
-
name
= 'Base Catalog Filter'¶
-
polymorphic_ctype
¶ Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
-
polymorphic_primary_key_name
= 'id'¶
-
polymorphic_super_sub_accessors_replaced
= False¶
-
productfilter
¶ Accessor to the related object on the reverse side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Place.restaurant
is aReverseOneToOneDescriptor
instance.
-
producttypefilter
¶ Accessor to the related object on the reverse side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Place.restaurant
is aReverseOneToOneDescriptor
instance.
-
class
shuup.campaigns.models.
CatalogFilterCachedShopProduct
(id, filter, shop_product)[source]¶ Bases:
django.db.models.base.Model
Parameters: - id (AutoField) – Id
- filter (ForeignKey to
shuup.campaigns.models.catalog_filters.CatalogFilter
) – Filter - shop_product (ForeignKey to
shuup.core.models.ShopProduct
) – Shop product
-
exception
DoesNotExist
¶ Bases:
django.core.exceptions.ObjectDoesNotExist
-
exception
MultipleObjectsReturned
¶ Bases:
django.core.exceptions.MultipleObjectsReturned
-
filter
¶ Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
-
filter_id
¶ 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>¶
-
shop_product
¶ Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
-
shop_product_id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
class
shuup.campaigns.models.
CategoryFilter
(id, polymorphic_ctype, active, catalogfilter_ptr)[source]¶ Bases:
shuup.campaigns.models.catalog_filters.CatalogFilter
Parameters: - id (AutoField) – Id
- polymorphic_ctype (ForeignKey to
django.contrib.contenttypes.models.ContentType
) – Polymorphic ctype - active (BooleanField) – Active
- catalogfilter_ptr (OneToOneField to
shuup.campaigns.models.catalog_filters.CatalogFilter
) – Catalogfilter ptr - categories (ManyToManyField to
shuup.core.models.Category
) – Categories
-
cached_shop_products
¶ ManyToOneRel to
shuup.campaigns.models.cache.CatalogFilterCachedShopProduct
Replace Django’s inheritance accessor member functions for our model (self.__class__) with our own versions. We monkey patch them until a patch can be added to Django (which would probably be very small and make all of this obsolete).
If we have inheritance of the form ModelA -> ModelB ->ModelC then Django creates accessors like this: - ModelA: modelb - ModelB: modela_ptr, modelb, modelc - ModelC: modela_ptr, modelb, modelb_ptr, modelc
These accessors allow Django (and everyone else) to travel up and down the inheritance tree for the db object at hand.
The original Django accessors use our polymorphic manager. But they should not. So we replace them with our own accessors that use our appropriate base_objects manager.
Parameters: - id (AutoField) – Id
- polymorphic_ctype (ForeignKey to
django.contrib.contenttypes.models.ContentType
) – Polymorphic ctype - active (BooleanField) – Active
- catalogfilter_ptr (OneToOneField to
shuup.campaigns.models.catalog_filters.CatalogFilter
) – Catalogfilter ptr - categories (ManyToManyField to
shuup.core.models.Category
) – Categories
-
cached_shop_products
ManyToOneRel to
shuup.campaigns.models.cache.CatalogFilterCachedShopProduct
-
exception
DoesNotExist
¶ Bases:
shuup.campaigns.models.catalog_filters.DoesNotExist
-
exception
MultipleObjectsReturned
¶ Bases:
shuup.campaigns.models.catalog_filters.MultipleObjectsReturned
-
catalogfilter_ptr
¶ Accessor to the related object on the forward side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Restaurant.place
is aForwardOneToOneDescriptor
instance.
-
catalogfilter_ptr_id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
categories
¶ Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.
In the example:
class Pizza(Model): toppings = ManyToManyField(Topping, related_name='pizzas')
Pizza.toppings
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
-
description
¶
-
identifier
= 'category_filter'¶
-
model
¶ alias of
Category
-
name
= 'Product Category'¶
-
polymorphic_primary_key_name
= 'id'¶
-
polymorphic_super_sub_accessors_replaced
= False¶
-
values
¶
-
class
shuup.campaigns.models.
ProductFilter
(id, polymorphic_ctype, active, catalogfilter_ptr)[source]¶ Bases:
shuup.campaigns.models.catalog_filters.CatalogFilter
Parameters: - id (AutoField) – Id
- polymorphic_ctype (ForeignKey to
django.contrib.contenttypes.models.ContentType
) – Polymorphic ctype - active (BooleanField) – Active
- catalogfilter_ptr (OneToOneField to
shuup.campaigns.models.catalog_filters.CatalogFilter
) – Catalogfilter ptr - products (ManyToManyField to
shuup.core.models.Product
) – Product
-
cached_shop_products
¶ ManyToOneRel to
shuup.campaigns.models.cache.CatalogFilterCachedShopProduct
Replace Django’s inheritance accessor member functions for our model (self.__class__) with our own versions. We monkey patch them until a patch can be added to Django (which would probably be very small and make all of this obsolete).
If we have inheritance of the form ModelA -> ModelB ->ModelC then Django creates accessors like this: - ModelA: modelb - ModelB: modela_ptr, modelb, modelc - ModelC: modela_ptr, modelb, modelb_ptr, modelc
These accessors allow Django (and everyone else) to travel up and down the inheritance tree for the db object at hand.
The original Django accessors use our polymorphic manager. But they should not. So we replace them with our own accessors that use our appropriate base_objects manager.
Parameters: - id (AutoField) – Id
- polymorphic_ctype (ForeignKey to
django.contrib.contenttypes.models.ContentType
) – Polymorphic ctype - active (BooleanField) – Active
- catalogfilter_ptr (OneToOneField to
shuup.campaigns.models.catalog_filters.CatalogFilter
) – Catalogfilter ptr - products (ManyToManyField to
shuup.core.models.Product
) – Product
-
cached_shop_products
ManyToOneRel to
shuup.campaigns.models.cache.CatalogFilterCachedShopProduct
-
exception
DoesNotExist
¶ Bases:
shuup.campaigns.models.catalog_filters.DoesNotExist
-
exception
MultipleObjectsReturned
¶ Bases:
shuup.campaigns.models.catalog_filters.MultipleObjectsReturned
-
catalogfilter_ptr
¶ Accessor to the related object on the forward side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Restaurant.place
is aForwardOneToOneDescriptor
instance.
-
catalogfilter_ptr_id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
description
¶
-
identifier
= 'product_filter'¶
-
model
¶ alias of
Product
-
name
= 'Product'¶
-
polymorphic_primary_key_name
= 'id'¶
-
polymorphic_super_sub_accessors_replaced
= False¶
-
products
¶ Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.
In the example:
class Pizza(Model): toppings = ManyToManyField(Topping, related_name='pizzas')
Pizza.toppings
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
-
values
¶
-
class
shuup.campaigns.models.
ProductTypeFilter
(id, polymorphic_ctype, active, catalogfilter_ptr)[source]¶ Bases:
shuup.campaigns.models.catalog_filters.CatalogFilter
Parameters: - id (AutoField) – Id
- polymorphic_ctype (ForeignKey to
django.contrib.contenttypes.models.ContentType
) – Polymorphic ctype - active (BooleanField) – Active
- catalogfilter_ptr (OneToOneField to
shuup.campaigns.models.catalog_filters.CatalogFilter
) – Catalogfilter ptr - product_types (ManyToManyField to
shuup.core.models.ProductType
) – Product types
-
cached_shop_products
¶ ManyToOneRel to
shuup.campaigns.models.cache.CatalogFilterCachedShopProduct
Replace Django’s inheritance accessor member functions for our model (self.__class__) with our own versions. We monkey patch them until a patch can be added to Django (which would probably be very small and make all of this obsolete).
If we have inheritance of the form ModelA -> ModelB ->ModelC then Django creates accessors like this: - ModelA: modelb - ModelB: modela_ptr, modelb, modelc - ModelC: modela_ptr, modelb, modelb_ptr, modelc
These accessors allow Django (and everyone else) to travel up and down the inheritance tree for the db object at hand.
The original Django accessors use our polymorphic manager. But they should not. So we replace them with our own accessors that use our appropriate base_objects manager.
Parameters: - id (AutoField) – Id
- polymorphic_ctype (ForeignKey to
django.contrib.contenttypes.models.ContentType
) – Polymorphic ctype - active (BooleanField) – Active
- catalogfilter_ptr (OneToOneField to
shuup.campaigns.models.catalog_filters.CatalogFilter
) – Catalogfilter ptr - product_types (ManyToManyField to
shuup.core.models.ProductType
) – Product types
-
cached_shop_products
ManyToOneRel to
shuup.campaigns.models.cache.CatalogFilterCachedShopProduct
-
exception
DoesNotExist
¶ Bases:
shuup.campaigns.models.catalog_filters.DoesNotExist
-
exception
MultipleObjectsReturned
¶ Bases:
shuup.campaigns.models.catalog_filters.MultipleObjectsReturned
-
catalogfilter_ptr
¶ Accessor to the related object on the forward side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Restaurant.place
is aForwardOneToOneDescriptor
instance.
-
catalogfilter_ptr_id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
description
¶
-
identifier
= 'product_type_filter'¶
-
model
¶ alias of
ProductType
-
name
= 'Product type'¶
-
polymorphic_primary_key_name
= 'id'¶
-
polymorphic_super_sub_accessors_replaced
= False¶
-
product_types
¶ Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.
In the example:
class Pizza(Model): toppings = ManyToManyField(Topping, related_name='pizzas')
Pizza.toppings
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
-
values
¶
-
class
shuup.campaigns.models.
ContextCondition
(id, polymorphic_ctype, active)[source]¶ Bases:
polymorphic.models.PolymorphicModel
Parameters: - id (AutoField) – Id
- polymorphic_ctype (ForeignKey to
django.contrib.contenttypes.models.ContentType
) – Polymorphic ctype - active (BooleanField) – Active
-
contactgroupcondition_set
¶ OneToOneRel to
shuup.campaigns.models.context_conditions.ContactGroupCondition
-
contactcondition_set
¶ OneToOneRel to
shuup.campaigns.models.context_conditions.ContactCondition
-
hourcondition_set
¶ OneToOneRel to
shuup.campaigns.models.context_conditions.HourCondition
Replace Django’s inheritance accessor member functions for our model (self.__class__) with our own versions. We monkey patch them until a patch can be added to Django (which would probably be very small and make all of this obsolete).
If we have inheritance of the form ModelA -> ModelB ->ModelC then Django creates accessors like this: - ModelA: modelb - ModelB: modela_ptr, modelb, modelc - ModelC: modela_ptr, modelb, modelb_ptr, modelc
These accessors allow Django (and everyone else) to travel up and down the inheritance tree for the db object at hand.
The original Django accessors use our polymorphic manager. But they should not. So we replace them with our own accessors that use our appropriate base_objects manager.
Parameters: - id (AutoField) – Id
- polymorphic_ctype (ForeignKey to
django.contrib.contenttypes.models.ContentType
) – Polymorphic ctype - active (BooleanField) – Active
-
contactgroupcondition_set
OneToOneRel to
shuup.campaigns.models.context_conditions.ContactGroupCondition
-
contactcondition_set
OneToOneRel to
shuup.campaigns.models.context_conditions.ContactCondition
-
hourcondition_set
OneToOneRel to
shuup.campaigns.models.context_conditions.HourCondition
-
exception
DoesNotExist
¶ Bases:
django.core.exceptions.ObjectDoesNotExist
-
exception
MultipleObjectsReturned
¶ Bases:
django.core.exceptions.MultipleObjectsReturned
-
active
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
campaign
¶ Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.
In the example:
class Pizza(Model): toppings = ManyToManyField(Topping, related_name='pizzas')
Pizza.toppings
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
-
contactcondition
¶ Accessor to the related object on the reverse side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Place.restaurant
is aReverseOneToOneDescriptor
instance.
-
contactgroupcondition
¶ Accessor to the related object on the reverse side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Place.restaurant
is aReverseOneToOneDescriptor
instance.
-
description
= 'Context Condition'¶
-
hourcondition
¶ Accessor to the related object on the reverse side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Place.restaurant
is aReverseOneToOneDescriptor
instance.
-
id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
identifier
= 'context_condition'¶
-
model
= None¶
-
name
= 'Context Condition'¶
-
polymorphic_ctype
¶ Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
-
polymorphic_primary_key_name
= 'id'¶
-
polymorphic_super_sub_accessors_replaced
= False¶
-
class
shuup.campaigns.models.
ContactGroupSalesRange
(id, group, shop, min_value, max_value)[source]¶ Bases:
django.db.models.base.Model
Parameters: - id (AutoField) – Id
- group (ForeignKey to
shuup.core.models.ContactGroup
) – Group - shop (ForeignKey to
shuup.core.models.Shop
) – Shop - min_value (MoneyValueField) – Min amount
- max_value (MoneyValueField) – Max amount
-
exception
DoesNotExist
¶ Bases:
django.core.exceptions.ObjectDoesNotExist
-
exception
MultipleObjectsReturned
¶ Bases:
django.core.exceptions.MultipleObjectsReturned
-
group
¶ Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
-
group_id
¶ 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.
-
max_value
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
min_value
¶ 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.ManagerFromSalesRangeQuerySet object>¶
-
shop
¶ Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
-
shop_id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
class
shuup.campaigns.models.
ContactCondition
(id, polymorphic_ctype, active, contextcondition_ptr)[source]¶ Bases:
shuup.campaigns.models.context_conditions.ContextCondition
Parameters: - id (AutoField) – Id
- polymorphic_ctype (ForeignKey to
django.contrib.contenttypes.models.ContentType
) – Polymorphic ctype - active (BooleanField) – Active
- contextcondition_ptr (OneToOneField to
shuup.campaigns.models.context_conditions.ContextCondition
) – Contextcondition ptr - contacts (ManyToManyField to
shuup.core.models.Contact
) – Contacts
Replace Django’s inheritance accessor member functions for our model (self.__class__) with our own versions. We monkey patch them until a patch can be added to Django (which would probably be very small and make all of this obsolete).
If we have inheritance of the form ModelA -> ModelB ->ModelC then Django creates accessors like this: - ModelA: modelb - ModelB: modela_ptr, modelb, modelc - ModelC: modela_ptr, modelb, modelb_ptr, modelc
These accessors allow Django (and everyone else) to travel up and down the inheritance tree for the db object at hand.
The original Django accessors use our polymorphic manager. But they should not. So we replace them with our own accessors that use our appropriate base_objects manager.
Parameters: - id (AutoField) – Id
- polymorphic_ctype (ForeignKey to
django.contrib.contenttypes.models.ContentType
) – Polymorphic ctype - active (BooleanField) – Active
- contextcondition_ptr (OneToOneField to
shuup.campaigns.models.context_conditions.ContextCondition
) – Contextcondition ptr - contacts (ManyToManyField to
shuup.core.models.Contact
) – Contacts
-
exception
DoesNotExist
¶ Bases:
shuup.campaigns.models.context_conditions.DoesNotExist
-
exception
MultipleObjectsReturned
¶ Bases:
shuup.campaigns.models.context_conditions.MultipleObjectsReturned
-
contacts
¶ Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.
In the example:
class Pizza(Model): toppings = ManyToManyField(Topping, related_name='pizzas')
Pizza.toppings
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
-
contextcondition_ptr
¶ Accessor to the related object on the forward side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Restaurant.place
is aForwardOneToOneDescriptor
instance.
-
contextcondition_ptr_id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
description
¶
-
identifier
= 'contact_condition'¶
-
model
¶ alias of
Contact
-
name
= 'Contact'¶
-
polymorphic_primary_key_name
= 'id'¶
-
polymorphic_super_sub_accessors_replaced
= False¶
-
values
¶
-
class
shuup.campaigns.models.
ContactGroupCondition
(id, polymorphic_ctype, active, contextcondition_ptr)[source]¶ Bases:
shuup.campaigns.models.context_conditions.ContextCondition
Parameters: - id (AutoField) – Id
- polymorphic_ctype (ForeignKey to
django.contrib.contenttypes.models.ContentType
) – Polymorphic ctype - active (BooleanField) – Active
- contextcondition_ptr (OneToOneField to
shuup.campaigns.models.context_conditions.ContextCondition
) – Contextcondition ptr - contact_groups (ManyToManyField to
shuup.core.models.ContactGroup
) – Contact groups
Replace Django’s inheritance accessor member functions for our model (self.__class__) with our own versions. We monkey patch them until a patch can be added to Django (which would probably be very small and make all of this obsolete).
If we have inheritance of the form ModelA -> ModelB ->ModelC then Django creates accessors like this: - ModelA: modelb - ModelB: modela_ptr, modelb, modelc - ModelC: modela_ptr, modelb, modelb_ptr, modelc
These accessors allow Django (and everyone else) to travel up and down the inheritance tree for the db object at hand.
The original Django accessors use our polymorphic manager. But they should not. So we replace them with our own accessors that use our appropriate base_objects manager.
Parameters: - id (AutoField) – Id
- polymorphic_ctype (ForeignKey to
django.contrib.contenttypes.models.ContentType
) – Polymorphic ctype - active (BooleanField) – Active
- contextcondition_ptr (OneToOneField to
shuup.campaigns.models.context_conditions.ContextCondition
) – Contextcondition ptr - contact_groups (ManyToManyField to
shuup.core.models.ContactGroup
) – Contact groups
-
exception
DoesNotExist
¶ Bases:
shuup.campaigns.models.context_conditions.DoesNotExist
-
exception
MultipleObjectsReturned
¶ Bases:
shuup.campaigns.models.context_conditions.MultipleObjectsReturned
-
contact_groups
¶ Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.
In the example:
class Pizza(Model): toppings = ManyToManyField(Topping, related_name='pizzas')
Pizza.toppings
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
-
contextcondition_ptr
¶ Accessor to the related object on the forward side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Restaurant.place
is aForwardOneToOneDescriptor
instance.
-
contextcondition_ptr_id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
description
¶
-
identifier
= 'contact_group_condition'¶
-
model
¶ alias of
ContactGroup
-
name
= 'Contact Group'¶
-
polymorphic_primary_key_name
= 'id'¶
-
polymorphic_super_sub_accessors_replaced
= False¶
-
values
¶
-
class
shuup.campaigns.models.
Coupon
(id, code, usage_limit_customer, usage_limit, active, shop, supplier, created_by, modified_by, created_on, modified_on)[source]¶ Bases:
django.db.models.base.Model
Parameters: - id (AutoField) – Id
- code (CharField) – Code
- usage_limit_customer (PositiveIntegerField) – Limit the amount of usages per a single customer.
- usage_limit (PositiveIntegerField) – Set the absolute limit of usages for this coupon. If the limit is zero (0), coupon can’t be used.
- active (BooleanField) – Is active
- shop (ForeignKey to
shuup.core.models.Shop
) – The shop where the coupon is active. - supplier (ForeignKey to
shuup.core.models.Supplier
) – Supplier - created_by (ForeignKey to
django.contrib.auth.models.User
) – Created by - modified_by (ForeignKey to
django.contrib.auth.models.User
) – Modified by - created_on (DateTimeField) – Created on
- modified_on (DateTimeField) – Modified on
-
campaign
¶ OneToOneRel to
shuup.campaigns.models.campaigns.BasketCampaign
-
usages
¶ ManyToOneRel to
shuup.campaigns.models.campaigns.CouponUsage
-
log_entries
¶ ManyToOneRel to
shuup.campaigns.models.campaigns.CouponLogEntry
-
exception
DoesNotExist
¶ Bases:
django.core.exceptions.ObjectDoesNotExist
-
exception
MultipleObjectsReturned
¶ Bases:
django.core.exceptions.MultipleObjectsReturned
-
active
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
add_log_entry
(message, identifier=None, kind=<LogEntryKind.OTHER: 0>, user=None, extra=None, save=True)¶
-
admin_url_suffix
= 'coupon'¶
-
attached
¶
-
campaign
Accessor to the related object on the reverse side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Place.restaurant
is aReverseOneToOneDescriptor
instance.
-
can_use_code
(customer)[source]¶ Check if customer can use the code.
Parameters: customer ( Contact
or None) –Return type: True|False
-
code
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
created_by
¶ Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
-
created_by_id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
created_on
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
exhausted
¶
-
get_next_by_created_on
(*, field=<django.db.models.fields.DateTimeField: created_on>, is_next=True, **kwargs)¶
-
get_next_by_modified_on
(*, field=<django.db.models.fields.DateTimeField: modified_on>, is_next=True, **kwargs)¶
-
get_previous_by_created_on
(*, field=<django.db.models.fields.DateTimeField: created_on>, is_next=False, **kwargs)¶
-
get_previous_by_modified_on
(*, field=<django.db.models.fields.DateTimeField: modified_on>, is_next=False, **kwargs)¶
-
has_been_used
(usage_count=1)[source]¶ See if code was already used the number of maximum times given
-
id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
log_entries
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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
-
modified_by
¶ Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
-
modified_by_id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
modified_on
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
name_field
= 'code'¶
-
objects
= <django.db.models.manager.Manager object>¶
-
search_fields
= ['code']¶
-
shop
¶ Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
-
shop_id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
supplier
¶ Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
-
supplier_id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
usage_limit
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
usage_limit_customer
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
usages
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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.