shoop.campaigns.models package

Submodules

shoop.campaigns.models.basket_conditions module

class shoop.campaigns.models.basket_conditions.BasketCondition(id, polymorphic_ctype, active)[source]

Bases: polymorphic.models.PolymorphicModel

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.

model = None
name = <django.utils.functional.lazy.<locals>.__proxy__ object>
matches(basket, lines)[source]
exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception BasketCondition.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

BasketCondition.base_objects = <django.db.models.manager.Manager object>
BasketCondition.basketmaxtotalamountcondition
BasketCondition.basketmaxtotalproductamountcondition
BasketCondition.baskettotalamountcondition
BasketCondition.baskettotalproductamountcondition
BasketCondition.campaign
BasketCondition.contactbasketcondition
BasketCondition.contactgroupbasketcondition
BasketCondition.objects = <polymorphic.managers.PolymorphicManager object>
BasketCondition.polymorphic_ctype
BasketCondition.polymorphic_primary_key_name = 'id'
BasketCondition.polymorphic_super_sub_accessors_replaced = False
BasketCondition.productsinbasketcondition
class shoop.campaigns.models.basket_conditions.BasketTotalProductAmountCondition(id, polymorphic_ctype, active, basketcondition_ptr, product_count)[source]

Bases: shoop.campaigns.models.basket_conditions.BasketCondition

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.

identifier = 'basket_product_condition'
name = <django.utils.functional.lazy.<locals>.__proxy__ object>
matches(basket, lines)[source]
description
value
exception DoesNotExist

Bases: shoop.campaigns.models.basket_conditions.DoesNotExist

exception BasketTotalProductAmountCondition.MultipleObjectsReturned

Bases: shoop.campaigns.models.basket_conditions.MultipleObjectsReturned

BasketTotalProductAmountCondition.base_objects = <django.db.models.manager.Manager object>
BasketTotalProductAmountCondition.basketcondition_ptr
BasketTotalProductAmountCondition.objects = <polymorphic.managers.PolymorphicManager object>
BasketTotalProductAmountCondition.polymorphic_primary_key_name = 'id'
BasketTotalProductAmountCondition.polymorphic_super_sub_accessors_replaced = False
class shoop.campaigns.models.basket_conditions.BasketTotalAmountCondition(id, polymorphic_ctype, active, basketcondition_ptr, amount_value)[source]

Bases: shoop.utils.properties.MoneyPropped, shoop.campaigns.models.basket_conditions.BasketCondition

identifier = 'basket_amount_condition'
name = <django.utils.functional.lazy.<locals>.__proxy__ object>
amount

Property for Price object.

Similar to MoneyProperty but also has includes_tax field.

Operaters with TaxfulPrice and TaxlessPrice objects.

matches(basket, lines)[source]
description
value
exception DoesNotExist

Bases: shoop.campaigns.models.basket_conditions.DoesNotExist

exception BasketTotalAmountCondition.MultipleObjectsReturned

Bases: shoop.campaigns.models.basket_conditions.MultipleObjectsReturned

BasketTotalAmountCondition.base_objects = <django.db.models.manager.Manager object>
BasketTotalAmountCondition.basketcondition_ptr
BasketTotalAmountCondition.objects = <polymorphic.managers.PolymorphicManager object>
BasketTotalAmountCondition.polymorphic_primary_key_name = 'id'
BasketTotalAmountCondition.polymorphic_super_sub_accessors_replaced = False
class shoop.campaigns.models.basket_conditions.BasketMaxTotalProductAmountCondition(id, polymorphic_ctype, active, basketcondition_ptr, product_count)[source]

Bases: shoop.campaigns.models.basket_conditions.BasketCondition

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.

identifier = 'basket_max_product_condition'
name = <django.utils.functional.lazy.<locals>.__proxy__ object>
matches(basket, lines)[source]
description
value
exception DoesNotExist

Bases: shoop.campaigns.models.basket_conditions.DoesNotExist

exception BasketMaxTotalProductAmountCondition.MultipleObjectsReturned

Bases: shoop.campaigns.models.basket_conditions.MultipleObjectsReturned

BasketMaxTotalProductAmountCondition.base_objects = <django.db.models.manager.Manager object>
BasketMaxTotalProductAmountCondition.basketcondition_ptr
BasketMaxTotalProductAmountCondition.objects = <polymorphic.managers.PolymorphicManager object>
BasketMaxTotalProductAmountCondition.polymorphic_primary_key_name = 'id'
BasketMaxTotalProductAmountCondition.polymorphic_super_sub_accessors_replaced = False
class shoop.campaigns.models.basket_conditions.BasketMaxTotalAmountCondition(id, polymorphic_ctype, active, basketcondition_ptr, amount_value)[source]

Bases: shoop.utils.properties.MoneyPropped, shoop.campaigns.models.basket_conditions.BasketCondition

identifier = 'basket_max_amount_condition'
name = <django.utils.functional.lazy.<locals>.__proxy__ object>
amount

Property for Price object.

Similar to MoneyProperty but also has includes_tax field.

Operaters with TaxfulPrice and TaxlessPrice objects.

matches(basket, lines)[source]
description
value
exception DoesNotExist

Bases: shoop.campaigns.models.basket_conditions.DoesNotExist

exception BasketMaxTotalAmountCondition.MultipleObjectsReturned

Bases: shoop.campaigns.models.basket_conditions.MultipleObjectsReturned

BasketMaxTotalAmountCondition.base_objects = <django.db.models.manager.Manager object>
BasketMaxTotalAmountCondition.basketcondition_ptr
BasketMaxTotalAmountCondition.objects = <polymorphic.managers.PolymorphicManager object>
BasketMaxTotalAmountCondition.polymorphic_primary_key_name = 'id'
BasketMaxTotalAmountCondition.polymorphic_super_sub_accessors_replaced = False
class shoop.campaigns.models.basket_conditions.ProductsInBasketCondition(id, polymorphic_ctype, active, basketcondition_ptr, quantity)[source]

Bases: shoop.campaigns.models.basket_conditions.BasketCondition

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.

identifier = 'basket_products_condition'
name = <django.utils.functional.lazy.<locals>.__proxy__ object>
model

alias of Product

products
matches(basket, lines)[source]
description
values
exception DoesNotExist

Bases: shoop.campaigns.models.basket_conditions.DoesNotExist

exception ProductsInBasketCondition.MultipleObjectsReturned

Bases: shoop.campaigns.models.basket_conditions.MultipleObjectsReturned

ProductsInBasketCondition.base_objects = <django.db.models.manager.Manager object>
ProductsInBasketCondition.basketcondition_ptr
ProductsInBasketCondition.objects = <polymorphic.managers.PolymorphicManager object>
ProductsInBasketCondition.polymorphic_primary_key_name = 'id'
ProductsInBasketCondition.polymorphic_super_sub_accessors_replaced = False
class shoop.campaigns.models.basket_conditions.ContactGroupBasketCondition(id, polymorphic_ctype, active, basketcondition_ptr)[source]

Bases: shoop.campaigns.models.basket_conditions.BasketCondition

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.

model

alias of ContactGroup

identifier = 'basket_contact_group_condition'
name = <django.utils.functional.lazy.<locals>.__proxy__ object>
contact_groups
matches(basket, lines=[])[source]
description
values
exception DoesNotExist

Bases: shoop.campaigns.models.basket_conditions.DoesNotExist

exception ContactGroupBasketCondition.MultipleObjectsReturned

Bases: shoop.campaigns.models.basket_conditions.MultipleObjectsReturned

ContactGroupBasketCondition.base_objects = <django.db.models.manager.Manager object>
ContactGroupBasketCondition.basketcondition_ptr
ContactGroupBasketCondition.objects = <polymorphic.managers.PolymorphicManager object>
ContactGroupBasketCondition.polymorphic_primary_key_name = 'id'
ContactGroupBasketCondition.polymorphic_super_sub_accessors_replaced = False
class shoop.campaigns.models.basket_conditions.ContactBasketCondition(id, polymorphic_ctype, active, basketcondition_ptr)[source]

Bases: shoop.campaigns.models.basket_conditions.BasketCondition

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.

model

alias of Contact

exception DoesNotExist

Bases: shoop.campaigns.models.basket_conditions.DoesNotExist

exception ContactBasketCondition.MultipleObjectsReturned

Bases: shoop.campaigns.models.basket_conditions.MultipleObjectsReturned

ContactBasketCondition.base_objects = <django.db.models.manager.Manager object>
ContactBasketCondition.basketcondition_ptr
ContactBasketCondition.identifier = 'basket_contact_condition'
ContactBasketCondition.objects = <polymorphic.managers.PolymorphicManager object>
ContactBasketCondition.polymorphic_primary_key_name = 'id'
ContactBasketCondition.polymorphic_super_sub_accessors_replaced = False
ContactBasketCondition.name = <django.utils.functional.lazy.<locals>.__proxy__ object>
ContactBasketCondition.contacts
ContactBasketCondition.matches(basket, lines=[])[source]
ContactBasketCondition.description
ContactBasketCondition.values

shoop.campaigns.models.basket_effects module

class shoop.campaigns.models.basket_effects.BasketDiscountEffect(id, polymorphic_ctype, campaign)[source]

Bases: shoop.core.models.PolymorphicShoopModel

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.

identifier = None
model = None
admin_form_class = None
campaign
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 BasketDiscountEffect.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

BasketDiscountEffect.base_objects = <django.db.models.manager.Manager object>
BasketDiscountEffect.basketdiscountamount
BasketDiscountEffect.basketdiscountpercentage
BasketDiscountEffect.objects = <polymorphic.managers.PolymorphicManager object>
BasketDiscountEffect.polymorphic_ctype
BasketDiscountEffect.polymorphic_primary_key_name = 'id'
BasketDiscountEffect.polymorphic_super_sub_accessors_replaced = False
class shoop.campaigns.models.basket_effects.BasketDiscountAmount(id, polymorphic_ctype, campaign, basketdiscounteffect_ptr, discount_amount)[source]

Bases: shoop.campaigns.models.basket_effects.BasketDiscountEffect

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.

identifier = 'discount_amount_effect'
name = <django.utils.functional.lazy.<locals>.__proxy__ object>
description
value
apply_for_basket(order_source)[source]
exception DoesNotExist

Bases: shoop.campaigns.models.basket_effects.DoesNotExist

exception BasketDiscountAmount.MultipleObjectsReturned

Bases: shoop.campaigns.models.basket_effects.MultipleObjectsReturned

BasketDiscountAmount.base_objects = <django.db.models.manager.Manager object>
BasketDiscountAmount.basketdiscounteffect_ptr
BasketDiscountAmount.objects = <polymorphic.managers.PolymorphicManager object>
BasketDiscountAmount.polymorphic_primary_key_name = 'id'
BasketDiscountAmount.polymorphic_super_sub_accessors_replaced = False
class shoop.campaigns.models.basket_effects.BasketDiscountPercentage(id, polymorphic_ctype, campaign, basketdiscounteffect_ptr, discount_percentage)[source]

Bases: shoop.campaigns.models.basket_effects.BasketDiscountEffect

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.

identifier = 'discount_percentage_effect'
name = <django.utils.functional.lazy.<locals>.__proxy__ object>
admin_form_class

alias of PercentageField

description
exception DoesNotExist

Bases: shoop.campaigns.models.basket_effects.DoesNotExist

exception BasketDiscountPercentage.MultipleObjectsReturned

Bases: shoop.campaigns.models.basket_effects.MultipleObjectsReturned

BasketDiscountPercentage.base_objects = <django.db.models.manager.Manager object>
BasketDiscountPercentage.basketdiscounteffect_ptr
BasketDiscountPercentage.objects = <polymorphic.managers.PolymorphicManager object>
BasketDiscountPercentage.polymorphic_primary_key_name = 'id'
BasketDiscountPercentage.polymorphic_super_sub_accessors_replaced = False
BasketDiscountPercentage.value
BasketDiscountPercentage.apply_for_basket(order_source)[source]

shoop.campaigns.models.basket_line_effects module

class shoop.campaigns.models.basket_line_effects.BasketLineEffect(id, polymorphic_ctype, campaign)[source]

Bases: shoop.core.models.PolymorphicShoopModel

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.

identifier = None
model = None
admin_form_class = None
campaign
get_discount_lines(order_source, original_lines)[source]

Applies the effect based on given order_source

Returns:amount of discount to accumulate for the product
Return type:Iterable[shoop.core.order_creator.SourceLine]
exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception BasketLineEffect.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

BasketLineEffect.base_objects = <django.db.models.manager.Manager object>
BasketLineEffect.discountfromproduct
BasketLineEffect.freeproductline
BasketLineEffect.objects = <polymorphic.managers.PolymorphicManager object>
BasketLineEffect.polymorphic_ctype
BasketLineEffect.polymorphic_primary_key_name = 'id'
BasketLineEffect.polymorphic_super_sub_accessors_replaced = False
class shoop.campaigns.models.basket_line_effects.FreeProductLine(id, polymorphic_ctype, campaign, basketlineeffect_ptr, quantity)[source]

Bases: shoop.campaigns.models.basket_line_effects.BasketLineEffect

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.

identifier = 'free_product_line_effect'
model

alias of Product

name = <django.utils.functional.lazy.<locals>.__proxy__ object>
products
description
values
get_discount_lines(order_source, original_lines)[source]
exception DoesNotExist

Bases: shoop.campaigns.models.basket_line_effects.DoesNotExist

exception FreeProductLine.MultipleObjectsReturned

Bases: shoop.campaigns.models.basket_line_effects.MultipleObjectsReturned

FreeProductLine.base_objects = <django.db.models.manager.Manager object>
FreeProductLine.basketlineeffect_ptr
FreeProductLine.objects = <polymorphic.managers.PolymorphicManager object>
FreeProductLine.polymorphic_primary_key_name = 'id'
FreeProductLine.polymorphic_super_sub_accessors_replaced = False
class shoop.campaigns.models.basket_line_effects.DiscountFromProduct(id, polymorphic_ctype, campaign, basketlineeffect_ptr, per_line_discount, discount_amount)[source]

Bases: shoop.campaigns.models.basket_line_effects.BasketLineEffect

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.

identifier = 'discount_from_product_line_effect'
model

alias of Product

name = <django.utils.functional.lazy.<locals>.__proxy__ object>
products
description
exception DoesNotExist

Bases: shoop.campaigns.models.basket_line_effects.DoesNotExist

exception DiscountFromProduct.MultipleObjectsReturned

Bases: shoop.campaigns.models.basket_line_effects.MultipleObjectsReturned

DiscountFromProduct.base_objects = <django.db.models.manager.Manager object>
DiscountFromProduct.basketlineeffect_ptr
DiscountFromProduct.get_discount_lines(order_source, original_lines)[source]
DiscountFromProduct.objects = <polymorphic.managers.PolymorphicManager object>
DiscountFromProduct.polymorphic_primary_key_name = 'id'
DiscountFromProduct.polymorphic_super_sub_accessors_replaced = False

shoop.campaigns.models.campaigns module

class shoop.campaigns.models.campaigns.CampaignType[source]

Bases: enumfields.enums.Enum

An enumeration.

CATALOG = <CampaignType.CATALOG: 1>
BASKET = <CampaignType.BASKET: 2>
class shoop.campaigns.models.campaigns.Campaign(*args, **kwargs)[source]

Bases: shoop.utils.properties.MoneyPropped, parler.models.TranslatableModel

admin_url_suffix = None
shop
created_by
modified_by
class Meta[source]

Bases: object

abstract = False
verbose_name = <django.utils.functional.lazy.<locals>.__proxy__ object>
verbose_name_plural = <django.utils.functional.lazy.<locals>.__proxy__ object>
Campaign.is_available()[source]
Campaign.type
Campaign.get_next_by_created_on(*moreargs, **morekwargs)
Campaign.get_next_by_modified_on(*moreargs, **morekwargs)
Campaign.get_previous_by_created_on(*moreargs, **morekwargs)
Campaign.get_previous_by_modified_on(*moreargs, **morekwargs)
Campaign.objects
class shoop.campaigns.models.campaigns.CatalogCampaign(id, shop, name, identifier, active, start_datetime, end_datetime, created_by, modified_by, created_on, modified_on)[source]

Bases: shoop.campaigns.models.campaigns.Campaign

admin_url_suffix = 'catalog_campaigns'
conditions
filters
translations
rules_match(context, shop_product)[source]
classmethod get_matching(context, product)[source]
exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception CatalogCampaign.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

CatalogCampaign.created_by
CatalogCampaign.effects
CatalogCampaign.get_next_by_created_on(*moreargs, **morekwargs)
CatalogCampaign.get_next_by_modified_on(*moreargs, **morekwargs)
CatalogCampaign.get_previous_by_created_on(*moreargs, **morekwargs)
CatalogCampaign.get_previous_by_modified_on(*moreargs, **morekwargs)
CatalogCampaign.modified_by
CatalogCampaign.objects = <parler.managers.TranslatableManager object>
CatalogCampaign.public_name

Descriptor for translated attributes.

This attribute proxies all get/set calls to the translated model.

CatalogCampaign.shop
class shoop.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)[source]

Bases: shoop.campaigns.models.campaigns.Campaign

admin_url_suffix = 'basket_campaigns'
conditions
coupon
translations
classmethod get_matching(basket, lines)[source]
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

System Message: ERROR/3 (/home/docs/checkouts/readthedocs.org/user_builds/shuup/checkouts/stable/shoop/campaigns/models/campaigns.py:docstring of shoop.campaigns.models.campaigns.BasketCampaign.rules_match, line 6)

Unexpected indentation.
which doesn’t match or is not active

System Message: WARNING/2 (/home/docs/checkouts/readthedocs.org/user_builds/shuup/checkouts/stable/shoop/campaigns/models/campaigns.py:docstring of shoop.campaigns.models.campaigns.BasketCampaign.rules_match, line 7)

Block quote ends without a blank line; unexpected unindent.
  1. Any of the attached rules doesn’t match
exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception BasketCampaign.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

BasketCampaign.created_by
BasketCampaign.discount_effects
BasketCampaign.get_next_by_created_on(*moreargs, **morekwargs)
BasketCampaign.get_next_by_modified_on(*moreargs, **morekwargs)
BasketCampaign.get_previous_by_created_on(*moreargs, **morekwargs)
BasketCampaign.get_previous_by_modified_on(*moreargs, **morekwargs)
BasketCampaign.line_effects
BasketCampaign.modified_by
BasketCampaign.objects = <parler.managers.TranslatableManager object>
BasketCampaign.public_name

Descriptor for translated attributes.

This attribute proxies all get/set calls to the translated model.

BasketCampaign.shop
class shoop.campaigns.models.campaigns.CouponUsage(id, coupon, order, created_by, modified_by, created_on, modified_on)[source]

Bases: django.db.models.base.Model

coupon
order
created_by
modified_by
classmethod add_usage(order, coupon)[source]
exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception CouponUsage.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

CouponUsage.get_next_by_created_on(*moreargs, **morekwargs)
CouponUsage.get_next_by_modified_on(*moreargs, **morekwargs)
CouponUsage.get_previous_by_created_on(*moreargs, **morekwargs)
CouponUsage.get_previous_by_modified_on(*moreargs, **morekwargs)
CouponUsage.objects = <django.db.models.manager.Manager object>
class shoop.campaigns.models.campaigns.Coupon(id, code, usage_limit_customer, usage_limit, active, created_by, modified_by, created_on, modified_on)[source]

Bases: django.db.models.base.Model

admin_url_suffix = 'coupons'
created_by
modified_by
classmethod generate_code(length=6)[source]
exhausted
attached
attach_to_campaign(campaign)[source]
classmethod is_usable(code, customer)[source]
can_use_code(customer)[source]

Check if customer can use the code

Parameters:customer (Contact or None) –
Return type:True|False
use(order)[source]
increase_customer_usage_limit_by(amount)[source]
increase_usage_limit_by(amount)[source]
has_been_used(usage_count=1)[source]

See if code is used the times given

save(**kwargs)[source]
exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception Coupon.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

Coupon.campaign
Coupon.get_next_by_created_on(*moreargs, **morekwargs)
Coupon.get_next_by_modified_on(*moreargs, **morekwargs)
Coupon.get_previous_by_created_on(*moreargs, **morekwargs)
Coupon.get_previous_by_modified_on(*moreargs, **morekwargs)
Coupon.objects = <django.db.models.manager.Manager object>
Coupon.usages
class shoop.campaigns.models.campaigns.BasketCampaignTranslation(id, language_code, public_name, master)

Bases: parler.models.TranslatedFieldsModel

exception DoesNotExist

Bases: parler.models.TranslationDoesNotExist, shoop.campaigns.models.campaigns.DoesNotExist, shoop.campaigns.models.campaigns.DoesNotExist

exception BasketCampaignTranslation.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

BasketCampaignTranslation.get_language_code_display(*moreargs, **morekwargs)
BasketCampaignTranslation.master
BasketCampaignTranslation.objects = <django.db.models.manager.Manager object>
class shoop.campaigns.models.campaigns.CatalogCampaignTranslation(id, language_code, public_name, master)

Bases: parler.models.TranslatedFieldsModel

exception DoesNotExist

Bases: parler.models.TranslationDoesNotExist, shoop.campaigns.models.campaigns.DoesNotExist, shoop.campaigns.models.campaigns.DoesNotExist

exception CatalogCampaignTranslation.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

CatalogCampaignTranslation.get_language_code_display(*moreargs, **morekwargs)
CatalogCampaignTranslation.master
CatalogCampaignTranslation.objects = <django.db.models.manager.Manager object>

shoop.campaigns.models.catalog_filters module

class shoop.campaigns.models.catalog_filters.CatalogFilter(id, polymorphic_ctype, active)[source]

Bases: polymorphic.models.PolymorphicModel

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.

model = None
identifier = 'base_catalog_filter'
name = <django.utils.functional.lazy.<locals>.__proxy__ object>
filter_queryset(queryset)[source]
exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception CatalogFilter.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

CatalogFilter.base_objects = <django.db.models.manager.Manager object>
CatalogFilter.campaign
CatalogFilter.categoryfilter
CatalogFilter.objects = <polymorphic.managers.PolymorphicManager object>
CatalogFilter.polymorphic_ctype
CatalogFilter.polymorphic_primary_key_name = 'id'
CatalogFilter.polymorphic_super_sub_accessors_replaced = False
CatalogFilter.productfilter
CatalogFilter.producttypefilter
class shoop.campaigns.models.catalog_filters.ProductTypeFilter(id, polymorphic_ctype, active, catalogfilter_ptr)[source]

Bases: shoop.campaigns.models.catalog_filters.CatalogFilter

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.

model

alias of ProductType

identifier = 'product_type_filter'
name = <django.utils.functional.lazy.<locals>.__proxy__ object>
product_types
filter_queryset(queryset)[source]
description
values
exception DoesNotExist

Bases: shoop.campaigns.models.catalog_filters.DoesNotExist

exception ProductTypeFilter.MultipleObjectsReturned

Bases: shoop.campaigns.models.catalog_filters.MultipleObjectsReturned

ProductTypeFilter.base_objects = <django.db.models.manager.Manager object>
ProductTypeFilter.catalogfilter_ptr
ProductTypeFilter.objects = <polymorphic.managers.PolymorphicManager object>
ProductTypeFilter.polymorphic_primary_key_name = 'id'
ProductTypeFilter.polymorphic_super_sub_accessors_replaced = False
class shoop.campaigns.models.catalog_filters.ProductFilter(id, polymorphic_ctype, active, catalogfilter_ptr)[source]

Bases: shoop.campaigns.models.catalog_filters.CatalogFilter

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.

model

alias of Product

identifier = 'product_filter'
name = <django.utils.functional.lazy.<locals>.__proxy__ object>
products
filter_queryset(queryset)[source]
description
values
exception DoesNotExist

Bases: shoop.campaigns.models.catalog_filters.DoesNotExist

exception ProductFilter.MultipleObjectsReturned

Bases: shoop.campaigns.models.catalog_filters.MultipleObjectsReturned

ProductFilter.base_objects = <django.db.models.manager.Manager object>
ProductFilter.catalogfilter_ptr
ProductFilter.objects = <polymorphic.managers.PolymorphicManager object>
ProductFilter.polymorphic_primary_key_name = 'id'
ProductFilter.polymorphic_super_sub_accessors_replaced = False
class shoop.campaigns.models.catalog_filters.CategoryFilter(id, polymorphic_ctype, active, catalogfilter_ptr)[source]

Bases: shoop.campaigns.models.catalog_filters.CatalogFilter

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.

model

alias of Category

identifier = 'category_filter'
name = <django.utils.functional.lazy.<locals>.__proxy__ object>
categories
filter_queryset(queryset)[source]
exception DoesNotExist

Bases: shoop.campaigns.models.catalog_filters.DoesNotExist

exception CategoryFilter.MultipleObjectsReturned

Bases: shoop.campaigns.models.catalog_filters.MultipleObjectsReturned

CategoryFilter.base_objects = <django.db.models.manager.Manager object>
CategoryFilter.catalogfilter_ptr
CategoryFilter.description
CategoryFilter.objects = <polymorphic.managers.PolymorphicManager object>
CategoryFilter.polymorphic_primary_key_name = 'id'
CategoryFilter.polymorphic_super_sub_accessors_replaced = False
CategoryFilter.values

shoop.campaigns.models.contact_group_sales_ranges module

class shoop.campaigns.models.contact_group_sales_ranges.SalesRangeQuerySet(model=None, query=None, using=None, hints=None)[source]

Bases: django.db.models.query.QuerySet

active(shop)[source]
class shoop.campaigns.models.contact_group_sales_ranges.ContactGroupSalesRange(id, group, shop, min_value, max_value)[source]

Bases: django.db.models.base.Model

group
shop
objects = <django.db.models.manager.ManagerFromSalesRangeQuerySet object>
save(*args, **kwargs)[source]
clean()[source]
is_active()[source]
exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception ContactGroupSalesRange.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

shoop.campaigns.models.context_conditions module

class shoop.campaigns.models.context_conditions.ContextCondition(id, polymorphic_ctype, active)[source]

Bases: polymorphic.models.PolymorphicModel

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.

model = None
identifier = 'context_condition'
name = <django.utils.functional.lazy.<locals>.__proxy__ object>
description = <django.utils.functional.lazy.<locals>.__proxy__ object>
matches(context)[source]
exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception ContextCondition.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

ContextCondition.base_objects = <django.db.models.manager.Manager object>
ContextCondition.campaign
ContextCondition.contactcondition
ContextCondition.contactgroupcondition
ContextCondition.objects = <polymorphic.managers.PolymorphicManager object>
ContextCondition.polymorphic_ctype
ContextCondition.polymorphic_primary_key_name = 'id'
ContextCondition.polymorphic_super_sub_accessors_replaced = False
class shoop.campaigns.models.context_conditions.ContactGroupCondition(id, polymorphic_ctype, active, contextcondition_ptr)[source]

Bases: shoop.campaigns.models.context_conditions.ContextCondition

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.

model

alias of ContactGroup

identifier = 'contact_group_condition'
name = <django.utils.functional.lazy.<locals>.__proxy__ object>
contact_groups
matches(context)[source]
description
values
exception DoesNotExist

Bases: shoop.campaigns.models.context_conditions.DoesNotExist

exception ContactGroupCondition.MultipleObjectsReturned

Bases: shoop.campaigns.models.context_conditions.MultipleObjectsReturned

ContactGroupCondition.base_objects = <django.db.models.manager.Manager object>
ContactGroupCondition.contextcondition_ptr
ContactGroupCondition.objects = <polymorphic.managers.PolymorphicManager object>
ContactGroupCondition.polymorphic_primary_key_name = 'id'
ContactGroupCondition.polymorphic_super_sub_accessors_replaced = False
class shoop.campaigns.models.context_conditions.ContactCondition(id, polymorphic_ctype, active, contextcondition_ptr)[source]

Bases: shoop.campaigns.models.context_conditions.ContextCondition

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.

model

alias of Contact

identifier = 'contact_condition'
name = <django.utils.functional.lazy.<locals>.__proxy__ object>
contacts
matches(context)[source]
description
exception DoesNotExist

Bases: shoop.campaigns.models.context_conditions.DoesNotExist

exception ContactCondition.MultipleObjectsReturned

Bases: shoop.campaigns.models.context_conditions.MultipleObjectsReturned

ContactCondition.base_objects = <django.db.models.manager.Manager object>
ContactCondition.contextcondition_ptr
ContactCondition.objects = <polymorphic.managers.PolymorphicManager object>
ContactCondition.polymorphic_primary_key_name = 'id'
ContactCondition.polymorphic_super_sub_accessors_replaced = False
ContactCondition.values

shoop.campaigns.models.product_effects module

class shoop.campaigns.models.product_effects.ProductDiscountEffect(id, polymorphic_ctype, campaign)[source]

Bases: shoop.core.models.PolymorphicShoopModel

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.

identifier = None
model = None
admin_form_class = None
campaign
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 ProductDiscountEffect.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

ProductDiscountEffect.base_objects = <django.db.models.manager.Manager object>
ProductDiscountEffect.objects = <polymorphic.managers.PolymorphicManager object>
ProductDiscountEffect.polymorphic_ctype
ProductDiscountEffect.polymorphic_primary_key_name = 'id'
ProductDiscountEffect.polymorphic_super_sub_accessors_replaced = False
ProductDiscountEffect.productdiscountamount
ProductDiscountEffect.productdiscountpercentage
class shoop.campaigns.models.product_effects.ProductDiscountAmount(id, polymorphic_ctype, campaign, productdiscounteffect_ptr, discount_amount)[source]

Bases: shoop.campaigns.models.product_effects.ProductDiscountEffect

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.

identifier = 'discount_amount_effect'
name = <django.utils.functional.lazy.<locals>.__proxy__ object>
description
value
apply_for_product(context, product, price_info)[source]
exception DoesNotExist

Bases: shoop.campaigns.models.product_effects.DoesNotExist

exception ProductDiscountAmount.MultipleObjectsReturned

Bases: shoop.campaigns.models.product_effects.MultipleObjectsReturned

ProductDiscountAmount.base_objects = <django.db.models.manager.Manager object>
ProductDiscountAmount.objects = <polymorphic.managers.PolymorphicManager object>
ProductDiscountAmount.polymorphic_primary_key_name = 'id'
ProductDiscountAmount.polymorphic_super_sub_accessors_replaced = False
ProductDiscountAmount.productdiscounteffect_ptr
class shoop.campaigns.models.product_effects.ProductDiscountPercentage(id, polymorphic_ctype, campaign, productdiscounteffect_ptr, discount_percentage)[source]

Bases: shoop.campaigns.models.product_effects.ProductDiscountEffect

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.

identifier = 'discount_percentage_effect'
name = <django.utils.functional.lazy.<locals>.__proxy__ object>
admin_form_class

alias of PercentageField

description
exception DoesNotExist

Bases: shoop.campaigns.models.product_effects.DoesNotExist

exception ProductDiscountPercentage.MultipleObjectsReturned

Bases: shoop.campaigns.models.product_effects.MultipleObjectsReturned

ProductDiscountPercentage.base_objects = <django.db.models.manager.Manager object>
ProductDiscountPercentage.objects = <polymorphic.managers.PolymorphicManager object>
ProductDiscountPercentage.polymorphic_primary_key_name = 'id'
ProductDiscountPercentage.polymorphic_super_sub_accessors_replaced = False
ProductDiscountPercentage.productdiscounteffect_ptr
ProductDiscountPercentage.value
ProductDiscountPercentage.apply_for_product(context, product, price_info)[source]

Module contents

class shoop.campaigns.models.BasketLineEffect(id, polymorphic_ctype, campaign)[source]

Bases: shoop.core.models.PolymorphicShoopModel

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.

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception BasketLineEffect.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

BasketLineEffect.admin_form_class = None
BasketLineEffect.base_objects = <django.db.models.manager.Manager object>
BasketLineEffect.campaign
BasketLineEffect.discountfromproduct
BasketLineEffect.freeproductline
BasketLineEffect.get_discount_lines(order_source, original_lines)[source]

Applies the effect based on given order_source

Returns:amount of discount to accumulate for the product
Return type:Iterable[shoop.core.order_creator.SourceLine]
BasketLineEffect.identifier = None
BasketLineEffect.model = None
BasketLineEffect.objects = <polymorphic.managers.PolymorphicManager object>
BasketLineEffect.polymorphic_ctype
BasketLineEffect.polymorphic_primary_key_name = 'id'
BasketLineEffect.polymorphic_super_sub_accessors_replaced = False
class shoop.campaigns.models.BasketCampaign(id, shop, name, identifier, active, start_datetime, end_datetime, created_by, modified_by, created_on, modified_on, basket_line_text, coupon)[source]

Bases: shoop.campaigns.models.campaigns.Campaign

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception BasketCampaign.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

BasketCampaign.admin_url_suffix = 'basket_campaigns'
BasketCampaign.conditions
BasketCampaign.coupon
BasketCampaign.created_by
BasketCampaign.discount_effects
classmethod BasketCampaign.get_matching(basket, lines)[source]
BasketCampaign.get_next_by_created_on(*moreargs, **morekwargs)
BasketCampaign.get_next_by_modified_on(*moreargs, **morekwargs)
BasketCampaign.get_previous_by_created_on(*moreargs, **morekwargs)
BasketCampaign.get_previous_by_modified_on(*moreargs, **morekwargs)
BasketCampaign.line_effects
BasketCampaign.modified_by
BasketCampaign.objects = <parler.managers.TranslatableManager object>
BasketCampaign.public_name

Descriptor for translated attributes.

This attribute proxies all get/set calls to the translated model.

BasketCampaign.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

System Message: ERROR/3 (/home/docs/checkouts/readthedocs.org/user_builds/shuup/checkouts/stable/shoop/campaigns/models/__init__.py:docstring of shoop.campaigns.models.BasketCampaign.rules_match, line 6)

Unexpected indentation.
which doesn’t match or is not active

System Message: WARNING/2 (/home/docs/checkouts/readthedocs.org/user_builds/shuup/checkouts/stable/shoop/campaigns/models/__init__.py:docstring of shoop.campaigns.models.BasketCampaign.rules_match, line 7)

Block quote ends without a blank line; unexpected unindent.
  1. Any of the attached rules doesn’t match
BasketCampaign.shop
BasketCampaign.translations
class shoop.campaigns.models.BasketDiscountEffect(id, polymorphic_ctype, campaign)[source]

Bases: shoop.core.models.PolymorphicShoopModel

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.

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception BasketDiscountEffect.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

BasketDiscountEffect.admin_form_class = None
BasketDiscountEffect.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
BasketDiscountEffect.base_objects = <django.db.models.manager.Manager object>
BasketDiscountEffect.basketdiscountamount
BasketDiscountEffect.basketdiscountpercentage
BasketDiscountEffect.campaign
BasketDiscountEffect.identifier = None
BasketDiscountEffect.model = None
BasketDiscountEffect.objects = <polymorphic.managers.PolymorphicManager object>
BasketDiscountEffect.polymorphic_ctype
BasketDiscountEffect.polymorphic_primary_key_name = 'id'
BasketDiscountEffect.polymorphic_super_sub_accessors_replaced = False
class shoop.campaigns.models.BasketCondition(id, polymorphic_ctype, active)[source]

Bases: polymorphic.models.PolymorphicModel

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.

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception BasketCondition.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

BasketCondition.base_objects = <django.db.models.manager.Manager object>
BasketCondition.basketmaxtotalamountcondition
BasketCondition.basketmaxtotalproductamountcondition
BasketCondition.baskettotalamountcondition
BasketCondition.baskettotalproductamountcondition
BasketCondition.campaign
BasketCondition.contactbasketcondition
BasketCondition.contactgroupbasketcondition
BasketCondition.matches(basket, lines)[source]
BasketCondition.model = None
BasketCondition.name = <django.utils.functional.lazy.<locals>.__proxy__ object>
BasketCondition.objects = <polymorphic.managers.PolymorphicManager object>
BasketCondition.polymorphic_ctype
BasketCondition.polymorphic_primary_key_name = 'id'
BasketCondition.polymorphic_super_sub_accessors_replaced = False
BasketCondition.productsinbasketcondition
class shoop.campaigns.models.Campaign(*args, **kwargs)[source]

Bases: shoop.utils.properties.MoneyPropped, parler.models.TranslatableModel

class Meta[source]

Bases: object

abstract = False
verbose_name = <django.utils.functional.lazy.<locals>.__proxy__ object>
verbose_name_plural = <django.utils.functional.lazy.<locals>.__proxy__ object>
Campaign.admin_url_suffix = None
Campaign.created_by
Campaign.get_next_by_created_on(*moreargs, **morekwargs)
Campaign.get_next_by_modified_on(*moreargs, **morekwargs)
Campaign.get_previous_by_created_on(*moreargs, **morekwargs)
Campaign.get_previous_by_modified_on(*moreargs, **morekwargs)
Campaign.is_available()[source]
Campaign.modified_by
Campaign.objects
Campaign.shop
Campaign.type
class shoop.campaigns.models.ProductDiscountEffect(id, polymorphic_ctype, campaign)[source]

Bases: shoop.core.models.PolymorphicShoopModel

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.

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception ProductDiscountEffect.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

ProductDiscountEffect.admin_form_class = None
ProductDiscountEffect.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
ProductDiscountEffect.base_objects = <django.db.models.manager.Manager object>
ProductDiscountEffect.campaign
ProductDiscountEffect.identifier = None
ProductDiscountEffect.model = None
ProductDiscountEffect.objects = <polymorphic.managers.PolymorphicManager object>
ProductDiscountEffect.polymorphic_ctype
ProductDiscountEffect.polymorphic_primary_key_name = 'id'
ProductDiscountEffect.polymorphic_super_sub_accessors_replaced = False
ProductDiscountEffect.productdiscountamount
ProductDiscountEffect.productdiscountpercentage
class shoop.campaigns.models.CatalogCampaign(id, shop, name, identifier, active, start_datetime, end_datetime, created_by, modified_by, created_on, modified_on)[source]

Bases: shoop.campaigns.models.campaigns.Campaign

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception CatalogCampaign.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

CatalogCampaign.admin_url_suffix = 'catalog_campaigns'
CatalogCampaign.conditions
CatalogCampaign.created_by
CatalogCampaign.effects
CatalogCampaign.filters
classmethod CatalogCampaign.get_matching(context, product)[source]
CatalogCampaign.get_next_by_created_on(*moreargs, **morekwargs)
CatalogCampaign.get_next_by_modified_on(*moreargs, **morekwargs)
CatalogCampaign.get_previous_by_created_on(*moreargs, **morekwargs)
CatalogCampaign.get_previous_by_modified_on(*moreargs, **morekwargs)
CatalogCampaign.modified_by
CatalogCampaign.objects = <parler.managers.TranslatableManager object>
CatalogCampaign.public_name

Descriptor for translated attributes.

This attribute proxies all get/set calls to the translated model.

CatalogCampaign.rules_match(context, shop_product)[source]
CatalogCampaign.shop
CatalogCampaign.translations
class shoop.campaigns.models.CatalogFilter(id, polymorphic_ctype, active)[source]

Bases: polymorphic.models.PolymorphicModel

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.

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception CatalogFilter.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

CatalogFilter.base_objects = <django.db.models.manager.Manager object>
CatalogFilter.campaign
CatalogFilter.categoryfilter
CatalogFilter.filter_queryset(queryset)[source]
CatalogFilter.identifier = 'base_catalog_filter'
CatalogFilter.model = None
CatalogFilter.name = <django.utils.functional.lazy.<locals>.__proxy__ object>
CatalogFilter.objects = <polymorphic.managers.PolymorphicManager object>
CatalogFilter.polymorphic_ctype
CatalogFilter.polymorphic_primary_key_name = 'id'
CatalogFilter.polymorphic_super_sub_accessors_replaced = False
CatalogFilter.productfilter
CatalogFilter.producttypefilter
class shoop.campaigns.models.ContactGroupSalesRange(id, group, shop, min_value, max_value)[source]

Bases: django.db.models.base.Model

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception ContactGroupSalesRange.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

ContactGroupSalesRange.clean()[source]
ContactGroupSalesRange.group
ContactGroupSalesRange.is_active()[source]
ContactGroupSalesRange.objects = <django.db.models.manager.ManagerFromSalesRangeQuerySet object>
ContactGroupSalesRange.save(*args, **kwargs)[source]
ContactGroupSalesRange.shop
class shoop.campaigns.models.ContextCondition(id, polymorphic_ctype, active)[source]

Bases: polymorphic.models.PolymorphicModel

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.

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception ContextCondition.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

ContextCondition.base_objects = <django.db.models.manager.Manager object>
ContextCondition.campaign
ContextCondition.contactcondition
ContextCondition.contactgroupcondition
ContextCondition.description = <django.utils.functional.lazy.<locals>.__proxy__ object>
ContextCondition.identifier = 'context_condition'
ContextCondition.matches(context)[source]
ContextCondition.model = None
ContextCondition.name = <django.utils.functional.lazy.<locals>.__proxy__ object>
ContextCondition.objects = <polymorphic.managers.PolymorphicManager object>
ContextCondition.polymorphic_ctype
ContextCondition.polymorphic_primary_key_name = 'id'
ContextCondition.polymorphic_super_sub_accessors_replaced = False
class shoop.campaigns.models.Coupon(id, code, usage_limit_customer, usage_limit, active, created_by, modified_by, created_on, modified_on)[source]

Bases: django.db.models.base.Model

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception Coupon.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

Coupon.admin_url_suffix = 'coupons'
Coupon.attach_to_campaign(campaign)[source]
Coupon.attached
Coupon.campaign
Coupon.can_use_code(customer)[source]

Check if customer can use the code

Parameters:customer (Contact or None) –
Return type:True|False
Coupon.created_by
Coupon.exhausted
classmethod Coupon.generate_code(length=6)[source]
Coupon.get_next_by_created_on(*moreargs, **morekwargs)
Coupon.get_next_by_modified_on(*moreargs, **morekwargs)
Coupon.get_previous_by_created_on(*moreargs, **morekwargs)
Coupon.get_previous_by_modified_on(*moreargs, **morekwargs)
Coupon.has_been_used(usage_count=1)[source]

See if code is used the times given

Coupon.increase_customer_usage_limit_by(amount)[source]
Coupon.increase_usage_limit_by(amount)[source]
classmethod Coupon.is_usable(code, customer)[source]
Coupon.modified_by
Coupon.objects = <django.db.models.manager.Manager object>
Coupon.save(**kwargs)[source]
Coupon.usages
Coupon.use(order)[source]