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
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
-
model
= None¶
-
name
= <django.utils.functional.lazy.<locals>.__proxy__ object>¶
-
exception
DoesNotExist
¶
-
exception
BasketCondition.
MultipleObjectsReturned
¶
-
BasketCondition.
base_objects
= <django.db.models.manager.Manager object>¶
-
BasketCondition.
campaign
¶
-
BasketCondition.
objects
= <polymorphic.managers.PolymorphicManager object>¶
-
BasketCondition.
polymorphic_ctype
¶
-
BasketCondition.
polymorphic_primary_key_name
= 'id'¶
-
BasketCondition.
polymorphic_super_sub_accessors_replaced
= False¶
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
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
-
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
¶
-
exception
BasketDiscountEffect.
MultipleObjectsReturned
¶
-
BasketDiscountEffect.
base_objects
= <django.db.models.manager.Manager object>¶
-
BasketDiscountEffect.
objects
= <polymorphic.managers.PolymorphicManager object>¶
-
BasketDiscountEffect.
polymorphic_ctype
¶
-
BasketDiscountEffect.
polymorphic_primary_key_name
= 'id'¶
-
BasketDiscountEffect.
polymorphic_super_sub_accessors_replaced
= False¶
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
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
-
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[shuup.core.order_creator.SourceLine]
-
exception
DoesNotExist
¶
-
exception
BasketLineEffect.
MultipleObjectsReturned
¶
-
BasketLineEffect.
base_objects
= <django.db.models.manager.Manager object>¶
-
BasketLineEffect.
objects
= <polymorphic.managers.PolymorphicManager object>¶
-
BasketLineEffect.
polymorphic_ctype
¶
-
BasketLineEffect.
polymorphic_primary_key_name
= 'id'¶
-
BasketLineEffect.
polymorphic_super_sub_accessors_replaced
= False¶
shuup.campaigns.models.campaigns module¶
-
class
shuup.campaigns.models.campaigns.
CampaignType
[source]¶ Bases:
enumfields.enums.Enum
An enumeration.
-
CATALOG
= <CampaignType.CATALOG: 1>¶
-
BASKET
= <CampaignType.BASKET: 2>¶
-
-
class
shuup.campaigns.models.campaigns.
CampaignQueryset
(model=None, query=None, using=None, hints=None)[source]¶
-
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) – Check this if the campaign is currently active. Please also set a start and 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
¶
-
created_by
¶
-
modified_by
¶
-
objects
¶
-
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.
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)¶
- 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) – Check this if the campaign is currently active. Please also set a start and 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
¶
-
filters
¶
-
translations
-
exception
DoesNotExist
¶
-
exception
CatalogCampaign.
MultipleObjectsReturned
¶
-
CatalogCampaign.
add_log_entry
(message, identifier=None, kind=<LogEntryKind.OTHER: 0>, user=None, extra=None, save=True)¶
-
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.
log_entries
-
CatalogCampaign.
modified_by
¶
-
CatalogCampaign.
objects
= <django.db.models.manager.ManagerFromCampaignQueryset object>¶
-
CatalogCampaign.
public_name
¶ Descriptor for translated attributes.
This attribute proxies all get/set calls to the translated model.
-
CatalogCampaign.
shop
¶
-
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)[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) – Check this if the campaign is currently active. Please also set a start and 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 basket.
- coupon (OneToOneField to
shuup.campaigns.models.campaigns.Coupon
) – Coupon - 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'¶
-
conditions
¶
-
coupon
¶
-
translations
-
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 doesn’t match
-
exception
DoesNotExist
¶
-
exception
BasketCampaign.
MultipleObjectsReturned
¶
-
BasketCampaign.
add_log_entry
(message, identifier=None, kind=<LogEntryKind.OTHER: 0>, user=None, extra=None, save=True)¶
-
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.
log_entries
-
BasketCampaign.
modified_by
¶
-
BasketCampaign.
objects
= <django.db.models.manager.ManagerFromCampaignQueryset object>¶
-
BasketCampaign.
public_name
¶ Descriptor for translated attributes.
This attribute proxies all get/set calls to the translated model.
-
BasketCampaign.
shop
¶
-
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
¶
-
order
¶
-
created_by
¶
-
modified_by
¶
-
exception
DoesNotExist
¶
-
exception
CouponUsage.
MultipleObjectsReturned
¶
-
CouponUsage.
add_log_entry
(message, identifier=None, kind=<LogEntryKind.OTHER: 0>, user=None, extra=None, save=True)¶
-
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.
log_entries
-
CouponUsage.
objects
= <django.db.models.manager.Manager object>¶
-
class
shuup.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
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 cannot be used.
- active (BooleanField) – Is 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
-
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']¶
-
created_by
¶
-
modified_by
¶
-
exhausted
¶
-
attached
¶
-
can_use_code
(customer)[source]¶ Check if customer can use the code
Parameters: customer ( Contact
or None) –Return type: True|False
-
exception
DoesNotExist
¶
-
exception
Coupon.
MultipleObjectsReturned
¶
-
Coupon.
add_log_entry
(message, identifier=None, kind=<LogEntryKind.OTHER: 0>, user=None, extra=None, save=True)¶
-
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.
log_entries
-
Coupon.
objects
= <django.db.models.manager.Manager object>¶
-
Coupon.
usages
-
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
¶
-
exception
CatalogCampaignLogEntry.
MultipleObjectsReturned
¶
-
CatalogCampaignLogEntry.
extra
¶ A placeholder class that provides a way to set the attribute on the model.
-
CatalogCampaignLogEntry.
get_kind_display
(*moreargs, **morekwargs)¶
-
CatalogCampaignLogEntry.
get_next_by_created_on
(*moreargs, **morekwargs)¶
-
CatalogCampaignLogEntry.
get_previous_by_created_on
(*moreargs, **morekwargs)¶
-
CatalogCampaignLogEntry.
kind
¶ A placeholder class that provides a way to set the attribute on the model.
-
CatalogCampaignLogEntry.
logged_model
¶ alias of
CatalogCampaign
-
CatalogCampaignLogEntry.
objects
= <django.db.models.manager.Manager object>¶
-
CatalogCampaignLogEntry.
target
¶
-
CatalogCampaignLogEntry.
user
¶
-
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
¶
-
exception
BasketCampaignLogEntry.
MultipleObjectsReturned
¶
-
BasketCampaignLogEntry.
extra
¶ A placeholder class that provides a way to set the attribute on the model.
-
BasketCampaignLogEntry.
get_kind_display
(*moreargs, **morekwargs)¶
-
BasketCampaignLogEntry.
get_next_by_created_on
(*moreargs, **morekwargs)¶
-
BasketCampaignLogEntry.
get_previous_by_created_on
(*moreargs, **morekwargs)¶
-
BasketCampaignLogEntry.
kind
¶ A placeholder class that provides a way to set the attribute on the model.
-
BasketCampaignLogEntry.
logged_model
¶ alias of
BasketCampaign
-
BasketCampaignLogEntry.
objects
= <django.db.models.manager.Manager object>¶
-
BasketCampaignLogEntry.
target
¶
-
BasketCampaignLogEntry.
user
¶
-
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
¶
-
exception
CouponLogEntry.
MultipleObjectsReturned
¶
-
CouponLogEntry.
extra
¶ A placeholder class that provides a way to set the attribute on the model.
-
CouponLogEntry.
get_kind_display
(*moreargs, **morekwargs)¶
-
CouponLogEntry.
get_next_by_created_on
(*moreargs, **morekwargs)¶
-
CouponLogEntry.
get_previous_by_created_on
(*moreargs, **morekwargs)¶
-
CouponLogEntry.
kind
¶ A placeholder class that provides a way to set the attribute on the model.
-
CouponLogEntry.
objects
= <django.db.models.manager.Manager object>¶
-
CouponLogEntry.
target
¶
-
CouponLogEntry.
user
¶
-
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
¶
-
exception
CouponUsageLogEntry.
MultipleObjectsReturned
¶
-
CouponUsageLogEntry.
extra
¶ A placeholder class that provides a way to set the attribute on the model.
-
CouponUsageLogEntry.
get_kind_display
(*moreargs, **morekwargs)¶
-
CouponUsageLogEntry.
get_next_by_created_on
(*moreargs, **morekwargs)¶
-
CouponUsageLogEntry.
get_previous_by_created_on
(*moreargs, **morekwargs)¶
-
CouponUsageLogEntry.
kind
¶ A placeholder class that provides a way to set the attribute on the model.
-
CouponUsageLogEntry.
logged_model
¶ alias of
CouponUsage
-
CouponUsageLogEntry.
objects
= <django.db.models.manager.Manager object>¶
-
CouponUsageLogEntry.
target
¶
-
CouponUsageLogEntry.
user
¶
-
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 (ForeignKey to
shuup.campaigns.models.campaigns.BasketCampaign
) – Master
-
exception
DoesNotExist
¶ Bases:
parler.models.TranslationDoesNotExist
,shuup.campaigns.models.campaigns.DoesNotExist
,shuup.campaigns.models.campaigns.DoesNotExist
-
exception
BasketCampaignTranslation.
MultipleObjectsReturned
¶
-
BasketCampaignTranslation.
get_language_code_display
(*moreargs, **morekwargs)¶
-
BasketCampaignTranslation.
master
¶
-
BasketCampaignTranslation.
objects
= <django.db.models.manager.Manager object>¶
-
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 (ForeignKey to
shuup.campaigns.models.campaigns.CatalogCampaign
) – Master
-
exception
DoesNotExist
¶ Bases:
parler.models.TranslationDoesNotExist
,shuup.campaigns.models.campaigns.DoesNotExist
,shuup.campaigns.models.campaigns.DoesNotExist
-
exception
CatalogCampaignTranslation.
MultipleObjectsReturned
¶
-
CatalogCampaignTranslation.
get_language_code_display
(*moreargs, **morekwargs)¶
-
CatalogCampaignTranslation.
master
¶
-
CatalogCampaignTranslation.
objects
= <django.db.models.manager.Manager object>¶
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
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
-
model
= None¶
-
identifier
= 'base_catalog_filter'¶
-
name
= <django.utils.functional.lazy.<locals>.__proxy__ object>¶
-
exception
DoesNotExist
¶
-
exception
CatalogFilter.
MultipleObjectsReturned
¶
-
CatalogFilter.
base_objects
= <django.db.models.manager.Manager object>¶
-
CatalogFilter.
campaign
¶
-
CatalogFilter.
objects
= <polymorphic.managers.PolymorphicManager object>¶
-
CatalogFilter.
polymorphic_ctype
¶
-
CatalogFilter.
polymorphic_primary_key_name
= 'id'¶
-
CatalogFilter.
polymorphic_super_sub_accessors_replaced
= False¶
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
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
-
model
= None¶
-
identifier
= 'context_condition'¶
-
name
= <django.utils.functional.lazy.<locals>.__proxy__ object>¶
-
description
= <django.utils.functional.lazy.<locals>.__proxy__ object>¶
-
exception
DoesNotExist
¶
-
exception
ContextCondition.
MultipleObjectsReturned
¶
-
ContextCondition.
base_objects
= <django.db.models.manager.Manager object>¶
-
ContextCondition.
campaign
¶
-
ContextCondition.
objects
= <polymorphic.managers.PolymorphicManager object>¶
-
ContextCondition.
polymorphic_ctype
¶
-
ContextCondition.
polymorphic_primary_key_name
= 'id'¶
-
ContextCondition.
polymorphic_super_sub_accessors_replaced
= False¶
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
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
-
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
¶
-
exception
ProductDiscountEffect.
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¶
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
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
-
exception
DoesNotExist
¶
-
exception
BasketLineEffect.
MultipleObjectsReturned
¶
-
BasketLineEffect.
admin_form_class
= None¶
-
BasketLineEffect.
base_objects
= <django.db.models.manager.Manager object>¶
-
BasketLineEffect.
campaign
¶
-
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[shuup.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
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)[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) – Check this if the campaign is currently active. Please also set a start and 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 basket.
- coupon (OneToOneField to
shuup.campaigns.models.campaigns.Coupon
) – Coupon - 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
¶
-
exception
BasketCampaign.
MultipleObjectsReturned
¶
-
BasketCampaign.
add_log_entry
(message, identifier=None, kind=<LogEntryKind.OTHER: 0>, user=None, extra=None, save=True)¶
-
BasketCampaign.
admin_url_suffix
= 'basket_campaign'¶
-
BasketCampaign.
conditions
¶
-
BasketCampaign.
coupon
¶
-
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.
log_entries
-
BasketCampaign.
modified_by
¶
-
BasketCampaign.
objects
= <django.db.models.manager.ManagerFromCampaignQueryset 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
which doesn’t match or is not active- Any of the attached rules doesn’t match
-
BasketCampaign.
shop
¶
-
BasketCampaign.
translations
-
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
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
-
exception
DoesNotExist
¶
-
exception
BasketDiscountEffect.
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.
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
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
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
-
exception
DoesNotExist
¶
-
exception
BasketCondition.
MultipleObjectsReturned
¶
-
BasketCondition.
base_objects
= <django.db.models.manager.Manager object>¶
-
BasketCondition.
campaign
¶
-
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¶
-
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) – Check this if the campaign is currently active. Please also set a start and 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
= <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.
modified_by
¶
-
Campaign.
objects
¶
-
Campaign.
shop
¶
-
Campaign.
type
¶
- shop (ForeignKey to
-
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
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
-
exception
DoesNotExist
¶
-
exception
CatalogFilter.
MultipleObjectsReturned
¶
-
CatalogFilter.
base_objects
= <django.db.models.manager.Manager object>¶
-
CatalogFilter.
campaign
¶
-
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¶
-
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
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
-
exception
DoesNotExist
¶
-
exception
ContextCondition.
MultipleObjectsReturned
¶
-
ContextCondition.
base_objects
= <django.db.models.manager.Manager object>¶
-
ContextCondition.
campaign
¶
-
ContextCondition.
description
= <django.utils.functional.lazy.<locals>.__proxy__ object>¶
-
ContextCondition.
identifier
= 'context_condition'¶
-
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
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
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
-
exception
DoesNotExist
¶
-
exception
ProductDiscountEffect.
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¶
-
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) – Check this if the campaign is currently active. Please also set a start and 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
¶
-
exception
CatalogCampaign.
MultipleObjectsReturned
¶
-
CatalogCampaign.
add_log_entry
(message, identifier=None, kind=<LogEntryKind.OTHER: 0>, user=None, extra=None, save=True)¶
-
CatalogCampaign.
admin_url_suffix
= 'catalog_campaign'¶
-
CatalogCampaign.
conditions
¶
-
CatalogCampaign.
created_by
¶
-
CatalogCampaign.
effects
-
CatalogCampaign.
filters
¶
-
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.
log_entries
-
CatalogCampaign.
modified_by
¶
-
CatalogCampaign.
objects
= <django.db.models.manager.ManagerFromCampaignQueryset 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, matching_catalog_filters, matching_context_conditions)[source]¶
-
CatalogCampaign.
shop
¶
-
CatalogCampaign.
translations
-
class
shuup.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
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 cannot be used.
- active (BooleanField) – Is 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
-
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
¶
-
exception
Coupon.
MultipleObjectsReturned
¶
-
Coupon.
add_log_entry
(message, identifier=None, kind=<LogEntryKind.OTHER: 0>, user=None, extra=None, save=True)¶
-
Coupon.
admin_url_suffix
= 'coupon'¶
-
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
¶
-
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.
log_entries
-
Coupon.
modified_by
¶
-
Coupon.
name_field
= 'code'¶
-
Coupon.
objects
= <django.db.models.manager.Manager object>¶
-
Coupon.
search_fields
= ['code']¶
-
Coupon.
usages