shuup.core.models package

Module contents

class shuup.core.models.AbstractOrderLine(*args, **kwargs)

Bases: shuup.utils.properties.MoneyPropped, django.db.models.base.Model, shuup.core.pricing.Priceful

Parameters:
  • product (UnsavedForeignKey to shuup.core.models.Product) – Product
  • supplier (UnsavedForeignKey to shuup.core.models.Supplier) – Supplier
  • parent_line (UnsavedForeignKey to shuup.core.models.AbstractOrderLine) – Parent line
  • ordering (IntegerField) – Ordering
  • type (EnumIntegerField) – Line type
  • sku (CharField) – Line sku
  • text (CharField) – Line text
  • accounting_identifier (CharField) – Accounting identifier
  • require_verification (BooleanField) – Require verification
  • verified (BooleanField) – Verified
  • extra_data (JSONField) – Extra data
  • quantity (QuantityField) – Quantity
  • base_unit_price_value (MoneyValueField) – Unit price amount (undiscounted)
  • discount_amount_value (MoneyValueField) – Total amount of discount
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>
AbstractOrderLine.base_unit_price

Property for Price object.

Similar to MoneyProperty but also has includes_tax field.

Operaters with TaxfulPrice and TaxlessPrice objects.

AbstractOrderLine.discount_amount

Property for Price object.

Similar to MoneyProperty but also has includes_tax field.

Operaters with TaxfulPrice and TaxlessPrice objects.

AbstractOrderLine.extra_data

A placeholder class that provides a way to set the attribute on the model.

AbstractOrderLine.get_type_display(*moreargs, **morekwargs)
AbstractOrderLine.max_refundable_amount
Return type:shuup.utils.money.Money
AbstractOrderLine.max_refundable_quantity
AbstractOrderLine.objects
AbstractOrderLine.parent_line
AbstractOrderLine.product
AbstractOrderLine.refunded_quantity
AbstractOrderLine.save(*args, **kwargs)[source]
AbstractOrderLine.shipped_quantity
AbstractOrderLine.supplier
AbstractOrderLine.tax_amount
Return type:shuup.utils.money.Money
AbstractOrderLine.type

A placeholder class that provides a way to set the attribute on the model.

class shuup.core.models.AbstractPayment(*args, **kwargs)

Bases: shuup.utils.properties.MoneyPropped, django.db.models.base.Model

Parameters:
  • created_on (DateTimeField) – Created on
  • gateway_id (CharField) – Gateway id
  • payment_identifier (CharField) – Identifier
  • amount_value (MoneyValueField) – Amount
  • foreign_amount_value (MoneyValueField) – Foreign amount
  • foreign_currency (CurrencyField) – Foreign amount currency
  • description (CharField) – Description
class Meta[source]

Bases: object

abstract = False
AbstractPayment.amount

Property for a Money amount.

Will return Money objects when the property is being get and accepts Money objects on set. Value and currency are read/written from/to other fields.

Fields are given as locators, that is a string in dotted format, e.g. locator "foo.bar" points to instance.foo.bar where instance is an instance of the class owning the MoneyProperty.

Setting value of this property to a Money object with different currency that is currently set (in the field pointed by the currency locator), will raise an UnitMixupError.

AbstractPayment.foreign_amount

Property for a Money amount.

Will return Money objects when the property is being get and accepts Money objects on set. Value and currency are read/written from/to other fields.

Fields are given as locators, that is a string in dotted format, e.g. locator "foo.bar" points to instance.foo.bar where instance is an instance of the class owning the MoneyProperty.

Setting value of this property to a Money object with different currency that is currently set (in the field pointed by the currency locator), will raise an UnitMixupError.

AbstractPayment.get_next_by_created_on(*moreargs, **morekwargs)
AbstractPayment.get_previous_by_created_on(*moreargs, **morekwargs)
class shuup.core.models.AnonymousContact(id, polymorphic_ctype, created_on, identifier, is_active, default_shipping_address, default_billing_address, default_shipping_method, default_payment_method, _language, marketing_permission, phone, www, timezone, prefix, name, suffix, name_ext, email, tax_group, merchant_notes, account_manager, contact_ptr)

Bases: shuup.core.models.Contact

Parameters:
  • id (AutoField) – Id
  • polymorphic_ctype (ForeignKey to django.contrib.contenttypes.models.ContentType) – Polymorphic ctype
  • created_on (DateTimeField) – Created on
  • identifier (InternalIdentifierField) – Do not change this value if you are not sure what you are doing.
  • is_active (BooleanField) – Check this if the contact is an active customer.
  • default_shipping_address (ForeignKey to shuup.core.models.MutableAddress) – Shipping address
  • default_billing_address (ForeignKey to shuup.core.models.MutableAddress) – Billing address
  • default_shipping_method (ForeignKey to shuup.core.models.ShippingMethod) – Default shipping method
  • default_payment_method (ForeignKey to shuup.core.models.PaymentMethod) – Default payment method
  • _language (LanguageField) – The primary language to be used in all communications with the contact.
  • marketing_permission (BooleanField) – Check this if the contact can receive marketing and promotional materials.
  • phone (CharField) – The primary phone number of the contact.
  • www (URLField) – The web address of the contact, if any.
  • timezone (TimeZoneField) – The timezone in which the contact resides. This can be used to target the delivery of promotional materials at a particular time.
  • prefix (CharField) – The name prefix of the contact. For example, Mr, Mrs, Dr, etc.
  • name (CharField) – The contact name
  • suffix (CharField) – The name suffix of the contact. For example, Sr, Jr, etc.
  • name_ext (CharField) – Name extension
  • email (EmailField) – The email that will receive order confirmations and promotional materials (if permitted).
  • tax_group (ForeignKey to shuup.core.models.CustomerTaxGroup) – Select the contact tax group to use for this contact. Tax groups can be used to customize the tax rules the that apply to any of this contacts orders. Tax groups are defined in Settings - Customer Tax Groups and can be applied to tax rules in Settings - Tax Rules
  • merchant_notes (TextField) – Enter any private notes for this customer that are only accessible in Shuup admin.
  • account_manager (ForeignKey to shuup.core.models.PersonContact) – Account manager
  • contact_ptr (OneToOneField to shuup.core.models.Contact) – Contact ptr
savedaddress_set

ManyToOneRel to shuup.core.models.SavedAddress

customer_core_baskets

ManyToOneRel to shuup.core.models.Basket

customer_orders

ManyToOneRel to shuup.core.models.Order

shop_set

ManyToOneRel to shuup.core.models.Shop

customer_baskets

ManyToOneRel to shuup.front.models.stored_basket.StoredBasket

exception DoesNotExist

Bases: shuup.core.models._contacts.DoesNotExist

exception AnonymousContact.MultipleObjectsReturned

Bases: shuup.core.models._contacts.MultipleObjectsReturned

AnonymousContact.base_objects = <django.db.models.manager.Manager object>
AnonymousContact.contact_ptr
AnonymousContact.default_contact_group_identifier = 'default_anonymous_group'
AnonymousContact.default_contact_group_name = <django.utils.functional.lazy.<locals>.__proxy__ object>
AnonymousContact.delete(*args, **kwargs)[source]
AnonymousContact.groups

Contact groups accessor for anonymous contact.

The base class already has a groups property via ContactGroup related_name, but this overrides it for AnonymousContact so that it will return a queryset containing just the anonymous contact group rather than returning the original related manager, which cannot work since AnonymousContact is not in the database.

This allows to use statements like this for all kinds of contacts, even AnonymousContact:

some_contact.groups.all()
Return type:django.db.QuerySet
AnonymousContact.id = None
AnonymousContact.is_anonymous = True
AnonymousContact.objects = <polymorphic.managers.PolymorphicManager object>
AnonymousContact.pk = None
AnonymousContact.polymorphic_primary_key_name = 'id'
AnonymousContact.polymorphic_super_sub_accessors_replaced = False
AnonymousContact.save(*args, **kwargs)[source]
class shuup.core.models.Attribute(id, identifier, searchable, type, visibility_mode)

Bases: parler.models.TranslatableModel

Parameters:
  • id (AutoField) – Id
  • identifier (InternalIdentifierField) – Do not change this value if you are not sure what you are doing.
  • searchable (BooleanField) – Searchable attributes will be used for product lookup when customers search your store.
  • type (EnumIntegerField) – The attribute data type. Attribute values can be set on the product editor page.
  • visibility_mode (EnumIntegerField) – Select the attribute visibility setting. Attributes can be shown on the product detail page or can be used to enhance product search results.
  • name (CharField) – (Translatable) The attribute name. Product attributes can be used to list the various features of a product and can be shown on the product detail page. The product attributes for a product are determined by the product type and can be set on the product editor page.
translations

ManyToOneRel to shuup.core.models._attributes.AttributeTranslation

log_entries

ManyToOneRel to shuup.core.models._attributes.AttributeLogEntry

productattribute_set

ManyToOneRel to shuup.core.models.ProductAttribute

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception Attribute.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

Attribute.add_log_entry(message, identifier=None, kind=<LogEntryKind.OTHER: 0>, user=None, extra=None, save=True)
Attribute.formfield(**kwargs)[source]

Get a form field for this attribute.

Parameters:kwargs – Kwargs to pass for the form field class.
Returns:Form field.
Return type:forms.Field
Attribute.get_type_display(*moreargs, **morekwargs)
Attribute.get_visibility_mode_display(*moreargs, **morekwargs)
Attribute.is_null_value(value)[source]

Find out whether the given value is null from this attribute’s point of view.

Parameters:value (object) – A value
Returns:Nulliness boolean
Return type:bool
Attribute.is_numeric
Attribute.is_stringy
Attribute.is_temporal
Attribute.is_translated
Attribute.log_entries
Attribute.name

Descriptor for translated attributes.

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

Attribute.objects = <django.db.models.manager.ManagerFromAttributeQuerySet object>
Attribute.product_types
Attribute.productattribute_set
Attribute.save(*args, **kwargs)[source]
Attribute.translations
Attribute.type

A placeholder class that provides a way to set the attribute on the model.

Attribute.visibility_mode

A placeholder class that provides a way to set the attribute on the model.

class shuup.core.models.AttributeType

Bases: enumfields.enums.Enum

An enumeration.

BOOLEAN = <AttributeType.BOOLEAN: 2>
DATE = <AttributeType.DATE: 11>
DATETIME = <AttributeType.DATETIME: 10>
DECIMAL = <AttributeType.DECIMAL: 3>
INTEGER = <AttributeType.INTEGER: 1>
TIMEDELTA = <AttributeType.TIMEDELTA: 4>
TRANSLATED_STRING = <AttributeType.TRANSLATED_STRING: 20>
UNTRANSLATED_STRING = <AttributeType.UNTRANSLATED_STRING: 21>
class shuup.core.models.AttributeVisibility

Bases: enumfields.enums.Enum

An enumeration.

HIDDEN = <AttributeVisibility.HIDDEN: 0>
NOT_VISIBLE = <AttributeVisibility.NOT_VISIBLE: 3>
SEARCHABLE_FIELD = <AttributeVisibility.SEARCHABLE_FIELD: 2>
SHOW_ON_PRODUCT_PAGE = <AttributeVisibility.SHOW_ON_PRODUCT_PAGE: 1>
class shuup.core.models.Basket(id, key, shop, customer, orderer, creator, created_on, updated_on, persistent, deleted, finished, title, data, taxless_total_price_value, taxful_total_price_value, currency, prices_include_tax, product_count)

Bases: shuup.utils.properties.MoneyPropped, django.db.models.base.Model

Parameters:
exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception Basket.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

Basket.creator
Basket.customer
Basket.data

A placeholder class that provides a way to set the attribute on the model.

Basket.get_next_by_created_on(*moreargs, **morekwargs)
Basket.get_next_by_updated_on(*moreargs, **morekwargs)
Basket.get_previous_by_created_on(*moreargs, **morekwargs)
Basket.get_previous_by_updated_on(*moreargs, **morekwargs)
Basket.objects = <django.db.models.manager.Manager object>
Basket.orderer
Basket.products
Basket.shop
Basket.taxful_total_price
Basket.taxless_total_price
class shuup.core.models.Carrier(*args, **kwargs)

Bases: shuup.core.models.ServiceProvider

Service provider interface for shipment processing.

Services provided by a carrier are shipping methods. To create a new shipping method for a carrier, use the create_service method.

Implementers of this interface will provide provide a list of shipping service choices and each related shipping method should have one of those service choices assigned to it.

Note: Carrier objects should never be created on their own but rather through a concrete subclass.

Parameters:
  • id (AutoField) – Id
  • polymorphic_ctype (ForeignKey to django.contrib.contenttypes.models.ContentType) – Polymorphic ctype
  • identifier (InternalIdentifierField) – Do not change this value if you are not sure what you are doing.
  • enabled (BooleanField) – Check this if this service provider can be used when placing orders
  • logo (FilerImageField to filer.models.imagemodels.Image) – Logo
  • serviceprovider_ptr (OneToOneField to shuup.core.models.ServiceProvider) – Serviceprovider ptr
  • name (CharField) – (Translatable) The service provider name.
base_translations

ManyToOneRel to shuup.core.models._service_base.ServiceProviderTranslation

shippingmethod_set

ManyToOneRel to shuup.core.models.ShippingMethod

customcarrier_set

OneToOneRel to shuup.core.models.CustomCarrier

log_entries

ManyToOneRel to shuup.core.models._service_shipping.CarrierLogEntry

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
  • identifier (InternalIdentifierField) – Do not change this value if you are not sure what you are doing.
  • enabled (BooleanField) – Check this if this service provider can be used when placing orders
  • logo (FilerImageField to filer.models.imagemodels.Image) – Logo
  • serviceprovider_ptr (OneToOneField to shuup.core.models.ServiceProvider) – Serviceprovider ptr
  • name (CharField) – (Translatable) The service provider name.
base_translations

ManyToOneRel to shuup.core.models._service_base.ServiceProviderTranslation

shippingmethod_set

ManyToOneRel to shuup.core.models.ShippingMethod

customcarrier_set

OneToOneRel to shuup.core.models.CustomCarrier

log_entries

ManyToOneRel to shuup.core.models._service_shipping.CarrierLogEntry

exception DoesNotExist

Bases: shuup.core.models._service_base.DoesNotExist

exception Carrier.MultipleObjectsReturned

Bases: shuup.core.models._service_base.MultipleObjectsReturned

Carrier.add_log_entry(message, identifier=None, kind=<LogEntryKind.OTHER: 0>, user=None, extra=None, save=True)
Carrier.base_objects = <parler.managers.TranslatableManager object>
Carrier.customcarrier
Carrier.delete(*args, **kwargs)[source]
Carrier.log_entries
Carrier.objects = <shuup.core.models._base._PolyTransManager object>
Carrier.polymorphic_primary_key_name = 'id'
Carrier.polymorphic_super_sub_accessors_replaced = False
Carrier.service_model

alias of ShippingMethod

Carrier.serviceprovider_ptr
Carrier.shippingmethod_set
class shuup.core.models.Category(id, parent, identifier, status, image, ordering, visibility, visible_in_menu)

Bases: mptt.models.MPTTModel, parler.models.TranslatableModel

Parameters:
  • id (AutoField) – Id
  • parent (TreeForeignKey to shuup.core.models.Category) – If your category is a sub-category of another category, you can link them here.
  • identifier (InternalIdentifierField) – Do not change this value if you are not sure what you are doing.
  • status (EnumIntegerField) – Here you can choose whether or not you want the category to be visible in your store.
  • image (FilerImageField to filer.models.imagemodels.Image) – Category image. Will be shown at theme.
  • ordering (IntegerField) – You can set the order of categories in your store numerically.
  • visibility (EnumIntegerField) – You can choose to limit who sees your category based on whether they are logged in or if they are part of a customer group.
  • visible_in_menu (BooleanField) – Check this if this category should be visible in menu.
  • lft (PositiveIntegerField) – Lft
  • rght (PositiveIntegerField) – Rght
  • tree_id (PositiveIntegerField) – Tree id
  • level (PositiveIntegerField) – Level
  • shops (ManyToManyField to shuup.core.models.Shop) – You can select which shops the category is visible in.
  • visibility_groups (ManyToManyField to shuup.core.models.ContactGroup) – Select the customer groups you would like to be able to see the category. These groups are defined in Contacts Settings - Contact Groups.
  • name (CharField) – (Translatable) Enter a descriptive name for your product category. Products can be found in menus and in search in your store under the category name.
  • description (TextField) – (Translatable) Give your product category a detailed description. This will help shoppers find your products under that category in your store and on the web.
  • slug (SlugField) – (Translatable) Enter a URL slug for your category. This is what your product category page URL will be. A default will be created using the category name.
translations

ManyToOneRel to shuup.core.models._categories.CategoryTranslation

children

ManyToOneRel to shuup.core.models.Category

log_entries

ManyToOneRel to shuup.core.models._categories.CategoryLogEntry

primary_shop_products

ManyToOneRel to shuup.core.models.ShopProduct

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception Category.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

Category.add_log_entry(message, identifier=None, kind=<LogEntryKind.OTHER: 0>, user=None, extra=None, save=True)
Category.children
Category.delete(using=None)[source]
Category.description

Descriptor for translated attributes.

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

Category.get_status_display(*moreargs, **morekwargs)
Category.get_visibility_display(*moreargs, **morekwargs)
Category.image
Category.is_visible(customer)[source]
Category.log_entries
Category.name

Descriptor for translated attributes.

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

Category.objects = <shuup.core.models._categories.CategoryManager object>
Category.parent
Category.primary_shop_products
Category.save(*args, **kwargs)[source]
Category.shop_products
Category.shops
Category.slug

Descriptor for translated attributes.

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

Category.soft_delete(user=None)[source]
Category.status

A placeholder class that provides a way to set the attribute on the model.

Category.translations
Category.visibility

A placeholder class that provides a way to set the attribute on the model.

Category.visibility_groups
class shuup.core.models.CategoryStatus

Bases: enumfields.enums.Enum

An enumeration.

DELETED = <CategoryStatus.DELETED: 2>
INVISIBLE = <CategoryStatus.INVISIBLE: 0>
VISIBLE = <CategoryStatus.VISIBLE: 1>
class shuup.core.models.CategoryVisibility

Bases: enumfields.enums.Enum

An enumeration.

VISIBLE_TO_ALL = <CategoryVisibility.VISIBLE_TO_ALL: 1>
VISIBLE_TO_GROUPS = <CategoryVisibility.VISIBLE_TO_GROUPS: 3>
VISIBLE_TO_LOGGED_IN = <CategoryVisibility.VISIBLE_TO_LOGGED_IN: 2>
class shuup.core.models.CompanyContact(id, polymorphic_ctype, created_on, identifier, is_active, default_shipping_address, default_billing_address, default_shipping_method, default_payment_method, _language, marketing_permission, phone, www, timezone, prefix, name, suffix, name_ext, email, tax_group, merchant_notes, account_manager, contact_ptr, tax_number)

Bases: shuup.core.models.Contact

Parameters:
  • id (AutoField) – Id
  • polymorphic_ctype (ForeignKey to django.contrib.contenttypes.models.ContentType) – Polymorphic ctype
  • created_on (DateTimeField) – Created on
  • identifier (InternalIdentifierField) – Do not change this value if you are not sure what you are doing.
  • is_active (BooleanField) – Check this if the contact is an active customer.
  • default_shipping_address (ForeignKey to shuup.core.models.MutableAddress) – Shipping address
  • default_billing_address (ForeignKey to shuup.core.models.MutableAddress) – Billing address
  • default_shipping_method (ForeignKey to shuup.core.models.ShippingMethod) – Default shipping method
  • default_payment_method (ForeignKey to shuup.core.models.PaymentMethod) – Default payment method
  • _language (LanguageField) – The primary language to be used in all communications with the contact.
  • marketing_permission (BooleanField) – Check this if the contact can receive marketing and promotional materials.
  • phone (CharField) – The primary phone number of the contact.
  • www (URLField) – The web address of the contact, if any.
  • timezone (TimeZoneField) – The timezone in which the contact resides. This can be used to target the delivery of promotional materials at a particular time.
  • prefix (CharField) – The name prefix of the contact. For example, Mr, Mrs, Dr, etc.
  • name (CharField) – The contact name
  • suffix (CharField) – The name suffix of the contact. For example, Sr, Jr, etc.
  • name_ext (CharField) – Name extension
  • email (EmailField) – The email that will receive order confirmations and promotional materials (if permitted).
  • tax_group (ForeignKey to shuup.core.models.CustomerTaxGroup) – Select the contact tax group to use for this contact. Tax groups can be used to customize the tax rules the that apply to any of this contacts orders. Tax groups are defined in Settings - Customer Tax Groups and can be applied to tax rules in Settings - Tax Rules
  • merchant_notes (TextField) – Enter any private notes for this customer that are only accessible in Shuup admin.
  • account_manager (ForeignKey to shuup.core.models.PersonContact) – Account manager
  • contact_ptr (OneToOneField to shuup.core.models.Contact) – Contact ptr
  • tax_number (CharField) – e.g. EIN in US or VAT code in Europe
  • members (ManyToManyField to shuup.core.models.Contact) – Members
savedaddress_set

ManyToOneRel to shuup.core.models.SavedAddress

customer_core_baskets

ManyToOneRel to shuup.core.models.Basket

customer_orders

ManyToOneRel to shuup.core.models.Order

shop_set

ManyToOneRel to shuup.core.models.Shop

customer_baskets

ManyToOneRel to shuup.front.models.stored_basket.StoredBasket

log_entries

ManyToOneRel to shuup.core.models._contacts.CompanyContactLogEntry

exception DoesNotExist

Bases: shuup.core.models._contacts.DoesNotExist

exception CompanyContact.MultipleObjectsReturned

Bases: shuup.core.models._contacts.MultipleObjectsReturned

CompanyContact.add_log_entry(message, identifier=None, kind=<LogEntryKind.OTHER: 0>, user=None, extra=None, save=True)
CompanyContact.base_objects = <django.db.models.manager.Manager object>
CompanyContact.contact_ptr
CompanyContact.default_contact_group_identifier = 'default_company_group'
CompanyContact.default_contact_group_name = <django.utils.functional.lazy.<locals>.__proxy__ object>
CompanyContact.default_tax_group_getter()
CompanyContact.full_name
CompanyContact.log_entries
CompanyContact.members
CompanyContact.objects = <polymorphic.managers.PolymorphicManager object>
CompanyContact.polymorphic_primary_key_name = 'id'
CompanyContact.polymorphic_super_sub_accessors_replaced = False
class shuup.core.models.ConfigurationItem(id, shop, key, value)

Bases: shuup.core.models.ShuupModel

Parameters:
  • id (AutoField) – Id
  • shop (ForeignKey to shuup.core.models.Shop) – Shop
  • key (CharField) – Key
  • value (JSONField) – Value
exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception ConfigurationItem.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

ConfigurationItem.objects = <django.db.models.manager.Manager object>
ConfigurationItem.shop
ConfigurationItem.value

A placeholder class that provides a way to set the attribute on the model.

class shuup.core.models.Contact(id, polymorphic_ctype, created_on, identifier, is_active, default_shipping_address, default_billing_address, default_shipping_method, default_payment_method, _language, marketing_permission, phone, www, timezone, prefix, name, suffix, name_ext, email, tax_group, merchant_notes, account_manager)

Bases: shuup.core.models.PolymorphicShuupModel

Parameters:
  • id (AutoField) – Id
  • polymorphic_ctype (ForeignKey to django.contrib.contenttypes.models.ContentType) – Polymorphic ctype
  • created_on (DateTimeField) – Created on
  • identifier (InternalIdentifierField) – Do not change this value if you are not sure what you are doing.
  • is_active (BooleanField) – Check this if the contact is an active customer.
  • default_shipping_address (ForeignKey to shuup.core.models.MutableAddress) – Shipping address
  • default_billing_address (ForeignKey to shuup.core.models.MutableAddress) – Billing address
  • default_shipping_method (ForeignKey to shuup.core.models.ShippingMethod) – Default shipping method
  • default_payment_method (ForeignKey to shuup.core.models.PaymentMethod) – Default payment method
  • _language (LanguageField) – The primary language to be used in all communications with the contact.
  • marketing_permission (BooleanField) – Check this if the contact can receive marketing and promotional materials.
  • phone (CharField) – The primary phone number of the contact.
  • www (URLField) – The web address of the contact, if any.
  • timezone (TimeZoneField) – The timezone in which the contact resides. This can be used to target the delivery of promotional materials at a particular time.
  • prefix (CharField) – The name prefix of the contact. For example, Mr, Mrs, Dr, etc.
  • name (CharField) – The contact name
  • suffix (CharField) – The name suffix of the contact. For example, Sr, Jr, etc.
  • name_ext (CharField) – Name extension
  • email (EmailField) – The email that will receive order confirmations and promotional materials (if permitted).
  • tax_group (ForeignKey to shuup.core.models.CustomerTaxGroup) – Select the contact tax group to use for this contact. Tax groups can be used to customize the tax rules the that apply to any of this contacts orders. Tax groups are defined in Settings - Customer Tax Groups and can be applied to tax rules in Settings - Tax Rules
  • merchant_notes (TextField) – Enter any private notes for this customer that are only accessible in Shuup admin.
  • account_manager (ForeignKey to shuup.core.models.PersonContact) – Account manager
savedaddress_set

ManyToOneRel to shuup.core.models.SavedAddress

customer_core_baskets

ManyToOneRel to shuup.core.models.Basket

customer_orders

ManyToOneRel to shuup.core.models.Order

shop_set

ManyToOneRel to shuup.core.models.Shop

companycontact_set

OneToOneRel to shuup.core.models.CompanyContact

personcontact_set

OneToOneRel to shuup.core.models.PersonContact

anonymouscontact_set

OneToOneRel to shuup.core.models.AnonymousContact

customer_baskets

ManyToOneRel to shuup.front.models.stored_basket.StoredBasket

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception Contact.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

Contact.account_manager
Contact.anonymouscontact
Contact.base_objects = <django.db.models.manager.Manager object>
Contact.company_memberships
Contact.companycontact
Contact.customer_baskets
Contact.customer_core_baskets
Contact.customer_orders
Contact.default_billing_address
Contact.default_contact_group_identifier = None
Contact.default_contact_group_name = None
Contact.default_payment_method
Contact.default_shipping_address
Contact.default_shipping_method
Contact.default_tax_group_getter = None
Contact.full_name
Contact.get__language_display(*moreargs, **morekwargs)
classmethod Contact.get_default_group()[source]

Get or create default contact group for the class.

Identifier of the group is specified by the class property default_contact_group_identifier.

If new group is created, its name is set to value of default_contact_group_name class property.

Return type:core.models.ContactGroup
Contact.get_next_by_created_on(*moreargs, **morekwargs)
Contact.get_previous_by_created_on(*moreargs, **morekwargs)
Contact.get_price_display_options()[source]

Get price display options of the contact.

If the default group (get_default_group) defines price display options and the contact is member of it, return it.

If contact is not (anymore) member of the default group or the default group does not define options, return one of the groups which defines options. If there is more than one such groups, it is undefined which options will be used.

If contact is not a member of any group that defines price display options, return default constructed PriceDisplayOptions.

Subclasses may still override this default behavior.

Return type:PriceDisplayOptions
Contact.get_timezone_display(*moreargs, **morekwargs)
Contact.groups
Contact.is_all_seeing = False
Contact.is_anonymous = False
Contact.language
Contact.objects = <polymorphic.managers.PolymorphicManager object>
Contact.personcontact
Contact.polymorphic_ctype
Contact.polymorphic_primary_key_name = 'id'
Contact.polymorphic_super_sub_accessors_replaced = False
Contact.save(*args, **kwargs)[source]
Contact.savedaddress_set
Contact.shop_set
Contact.tax_group
Contact.timezone

A placeholder class that provides a way to set the attribute on the model.

class shuup.core.models.ContactGroup(id, identifier, show_pricing, show_prices_including_taxes, hide_prices)

Bases: shuup.core.models.TranslatableShuupModel

Parameters:
  • id (AutoField) – Id
  • identifier (InternalIdentifierField) – Do not change this value if you are not sure what you are doing.
  • show_pricing (BooleanField) – Show as pricing option
  • show_prices_including_taxes (NullBooleanField) – Show prices including taxes
  • hide_prices (NullBooleanField) – Hide prices
  • members (ManyToManyField to shuup.core.models.Contact) – Members
  • name (CharField) – (Translatable) The contact group name. Contact groups can be used to target sales and campaigns to specific set of users.
translations

ManyToOneRel to shuup.core.models._contacts.ContactGroupTranslation

log_entries

ManyToOneRel to shuup.core.models._contacts.ContactGroupLogEntry

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception ContactGroup.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

ContactGroup.add_log_entry(message, identifier=None, kind=<LogEntryKind.OTHER: 0>, user=None, extra=None, save=True)
ContactGroup.can_delete()[source]
ContactGroup.delete(*args, **kwargs)[source]
ContactGroup.get_price_display_options()[source]
ContactGroup.groupavailabilitybehaviorcomponent_set
ContactGroup.log_entries
ContactGroup.members
ContactGroup.name

Descriptor for translated attributes.

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

ContactGroup.objects = <django.db.models.manager.ManagerFromContactGroupQuerySet object>
ContactGroup.translations
ContactGroup.visible_categories
ContactGroup.visible_products
class shuup.core.models.Counter(id, value)

Bases: django.db.models.base.Model

Parameters:
  • id (EnumIntegerField) – Identifier
  • value (IntegerField) – Value
exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception Counter.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

classmethod Counter.get_and_increment(id)[source]
Counter.get_id_display(*moreargs, **morekwargs)
Counter.id

A placeholder class that provides a way to set the attribute on the model.

Counter.objects = <django.db.models.manager.Manager object>
class shuup.core.models.CounterType

Bases: enumfields.enums.Enum

An enumeration.

ORDER_REFERENCE = <CounterType.ORDER_REFERENCE: 1>
class shuup.core.models.CountryLimitBehaviorComponent(id, polymorphic_ctype, servicebehaviorcomponent_ptr, available_in_countries, available_in_european_countries, unavailable_in_countries, unavailable_in_european_countries)

Bases: shuup.core.models.ServiceBehaviorComponent

Parameters:
  • id (AutoField) – Id
  • polymorphic_ctype (ForeignKey to django.contrib.contenttypes.models.ContentType) – Polymorphic ctype
  • servicebehaviorcomponent_ptr (OneToOneField to shuup.core.models.ServiceBehaviorComponent) – Servicebehaviorcomponent ptr
  • available_in_countries (JSONField) – Available in countries
  • available_in_european_countries (BooleanField) – Available in european countries
  • unavailable_in_countries (JSONField) – Unavailable in countries
  • unavailable_in_european_countries (BooleanField) – Unavailable in european countries
exception DoesNotExist

Bases: shuup.core.models._service_base.DoesNotExist

exception CountryLimitBehaviorComponent.MultipleObjectsReturned

Bases: shuup.core.models._service_base.MultipleObjectsReturned

CountryLimitBehaviorComponent.available_in_countries

A placeholder class that provides a way to set the attribute on the model.

CountryLimitBehaviorComponent.base_objects = <django.db.models.manager.Manager object>
CountryLimitBehaviorComponent.get_unavailability_reasons(service, source)[source]
CountryLimitBehaviorComponent.help_text = <django.utils.functional.lazy.<locals>.__proxy__ object>
CountryLimitBehaviorComponent.name = <django.utils.functional.lazy.<locals>.__proxy__ object>
CountryLimitBehaviorComponent.objects = <polymorphic.managers.PolymorphicManager object>
CountryLimitBehaviorComponent.polymorphic_primary_key_name = 'id'
CountryLimitBehaviorComponent.polymorphic_super_sub_accessors_replaced = False
CountryLimitBehaviorComponent.servicebehaviorcomponent_ptr
CountryLimitBehaviorComponent.unavailable_in_countries

A placeholder class that provides a way to set the attribute on the model.

class shuup.core.models.CustomCarrier(*args, **kwargs)

Bases: shuup.core.models.Carrier

Carrier without any integration or special processing.

Parameters:
base_translations

ManyToOneRel to shuup.core.models._service_base.ServiceProviderTranslation

shippingmethod_set

ManyToOneRel to shuup.core.models.ShippingMethod

log_entries

ManyToOneRel to shuup.core.models._service_shipping.CarrierLogEntry

carrierwithcheckoutphase_set

OneToOneRel to shuup.testing.models._methods.CarrierWithCheckoutPhase

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:
base_translations

ManyToOneRel to shuup.core.models._service_base.ServiceProviderTranslation

shippingmethod_set

ManyToOneRel to shuup.core.models.ShippingMethod

log_entries

ManyToOneRel to shuup.core.models._service_shipping.CarrierLogEntry

carrierwithcheckoutphase_set

OneToOneRel to shuup.testing.models._methods.CarrierWithCheckoutPhase

exception DoesNotExist

Bases: shuup.core.models._service_shipping.DoesNotExist

exception CustomCarrier.MultipleObjectsReturned

Bases: shuup.core.models._service_shipping.MultipleObjectsReturned

CustomCarrier.base_objects = <parler.managers.TranslatableManager object>
CustomCarrier.carrier_ptr
CustomCarrier.carrierwithcheckoutphase
CustomCarrier.get_service_choices()[source]
CustomCarrier.objects = <shuup.core.models._base._PolyTransManager object>
CustomCarrier.polymorphic_primary_key_name = 'id'
CustomCarrier.polymorphic_super_sub_accessors_replaced = False
class shuup.core.models.CustomerTaxGroup(id, identifier, enabled)

Bases: shuup.core.models.TranslatableShuupModel

Parameters:
  • id (AutoField) – Id
  • identifier (InternalIdentifierField) – Do not change this value if you are not sure what you are doing.
  • enabled (BooleanField) – Enabled
  • name (CharField) – (Translatable) The customer tax group name. Customer tax groups can be used to control how taxes are applied to a set of customers.
translations

ManyToOneRel to shuup.core.models._taxes.CustomerTaxGroupTranslation

log_entries

ManyToOneRel to shuup.core.models._taxes.CustomerTaxGroupLogEntry

contact_set

ManyToOneRel to shuup.core.models.Contact

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception CustomerTaxGroup.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

CustomerTaxGroup.add_log_entry(message, identifier=None, kind=<LogEntryKind.OTHER: 0>, user=None, extra=None, save=True)
CustomerTaxGroup.contact_set
classmethod CustomerTaxGroup.get_default_company_group()[source]
classmethod CustomerTaxGroup.get_default_person_group()[source]
CustomerTaxGroup.log_entries
CustomerTaxGroup.name

Descriptor for translated attributes.

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

CustomerTaxGroup.objects = <parler.managers.TranslatableManager object>
CustomerTaxGroup.taxrule_set
CustomerTaxGroup.translations
class shuup.core.models.CustomPaymentProcessor(*args, **kwargs)

Bases: shuup.core.models.PaymentProcessor

Payment processor without any integration or special processing.

Can be used for payment methods whose payments are processed manually.

Parameters:
  • id (AutoField) – Id
  • polymorphic_ctype (ForeignKey to django.contrib.contenttypes.models.ContentType) – Polymorphic ctype
  • identifier (InternalIdentifierField) – Do not change this value if you are not sure what you are doing.
  • enabled (BooleanField) – Check this if this service provider can be used when placing orders
  • logo (FilerImageField to filer.models.imagemodels.Image) – Logo
  • serviceprovider_ptr (OneToOneField to shuup.core.models.ServiceProvider) – Serviceprovider ptr
  • paymentprocessor_ptr (OneToOneField to shuup.core.models.PaymentProcessor) – Paymentprocessor ptr
  • rounding_quantize (DecimalField) – Rounding quantize for cash payment.
  • rounding_mode (EnumField) – Rounding mode for cash payment.
  • name (CharField) – (Translatable) The service provider name.
base_translations

ManyToOneRel to shuup.core.models._service_base.ServiceProviderTranslation

paymentmethod_set

ManyToOneRel to shuup.core.models.PaymentMethod

log_entries

ManyToOneRel to shuup.core.models._service_payment.PaymentProcessorLogEntry

paymentwithcheckoutphase_set

OneToOneRel to shuup.testing.models._methods.PaymentWithCheckoutPhase

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
  • identifier (InternalIdentifierField) – Do not change this value if you are not sure what you are doing.
  • enabled (BooleanField) – Check this if this service provider can be used when placing orders
  • logo (FilerImageField to filer.models.imagemodels.Image) – Logo
  • serviceprovider_ptr (OneToOneField to shuup.core.models.ServiceProvider) – Serviceprovider ptr
  • paymentprocessor_ptr (OneToOneField to shuup.core.models.PaymentProcessor) – Paymentprocessor ptr
  • rounding_quantize (DecimalField) – Rounding quantize for cash payment.
  • rounding_mode (EnumField) – Rounding mode for cash payment.
  • name (CharField) – (Translatable) The service provider name.
base_translations

ManyToOneRel to shuup.core.models._service_base.ServiceProviderTranslation

paymentmethod_set

ManyToOneRel to shuup.core.models.PaymentMethod

log_entries

ManyToOneRel to shuup.core.models._service_payment.PaymentProcessorLogEntry

paymentwithcheckoutphase_set

OneToOneRel to shuup.testing.models._methods.PaymentWithCheckoutPhase

exception DoesNotExist

Bases: shuup.core.models._service_payment.DoesNotExist

exception CustomPaymentProcessor.MultipleObjectsReturned

Bases: shuup.core.models._service_payment.MultipleObjectsReturned

CustomPaymentProcessor.base_objects = <parler.managers.TranslatableManager object>
CustomPaymentProcessor.get_rounding_mode_display(*moreargs, **morekwargs)
CustomPaymentProcessor.get_service_choices()[source]
CustomPaymentProcessor.objects = <shuup.core.models._base._PolyTransManager object>
CustomPaymentProcessor.paymentprocessor_ptr
CustomPaymentProcessor.paymentwithcheckoutphase
CustomPaymentProcessor.polymorphic_primary_key_name = 'id'
CustomPaymentProcessor.polymorphic_super_sub_accessors_replaced = False
CustomPaymentProcessor.process_payment_return_request(service, order, request)[source]
CustomPaymentProcessor.rounding_mode

A placeholder class that provides a way to set the attribute on the model.

class shuup.core.models.Currency(id, code, decimal_places)

Bases: django.db.models.base.Model

Parameters:
  • id (AutoField) – Id
  • code (CharField) – The ISO-4217 code of the currency
  • decimal_places (PositiveSmallIntegerField) – The number of decimal places supported by this currency.
log_entries

ManyToOneRel to shuup.core.models._currencies.CurrencyLogEntry

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception Currency.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

Currency.add_log_entry(message, identifier=None, kind=<LogEntryKind.OTHER: 0>, user=None, extra=None, save=True)
Currency.clean()[source]
Currency.identifier_attr = 'code'
Currency.log_entries
Currency.objects = <django.db.models.manager.Manager object>
Currency.save(*args, **kwargs)[source]
class shuup.core.models.DefaultOrderStatus

Bases: enumfields.enums.Enum

An enumeration.

CANCELED = <DefaultOrderStatus.CANCELED: 'complete'>
COMPLETE = <DefaultOrderStatus.COMPLETE: 'processing'>
INITIAL = <DefaultOrderStatus.INITIAL: 'initial'>
NONE = <DefaultOrderStatus.NONE: 'none'>
PROCESSING = <DefaultOrderStatus.PROCESSING: 'canceled'>
class shuup.core.models.DisplayUnit(id, internal_unit, ratio, decimals, comparison_value, allow_bare_number, default)

Bases: shuup.core.models.TranslatableShuupModel

Parameters:
  • id (AutoField) – Id
  • internal_unit (ForeignKey to shuup.core.models.SalesUnit) – The sales unit that this display unit is linked to.
  • ratio (QuantityField) – Size of the display unit in internal unit. E.g. if internal unit is kilogram and display unit is gram, ratio is 0.001.
  • decimals (PositiveSmallIntegerField) – The number of decimal places to use for values in the display unit. The internal values are still rounded based on settings of the internal unit.
  • comparison_value (QuantityField) – Value to use when displaying unit prices. E.g. if the display unit is g and the comparison value is 100, then unit prices are shown per 100g, like: $2.95 per 100g.
  • allow_bare_number (BooleanField) – If true, values of this unit can be shown without the symbol occasionally. Usually wanted if the unit is a piece, so that product listings can show just ‘$5.95’ rather than ‘$5.95 per pc.’.
  • default (BooleanField) – Use this display unit by default when displaying values of the internal unit.
  • name (CharField) – (Translatable) Name of the display unit, e.g. Grams.
  • symbol (CharField) – (Translatable) An abbreviated name of the display unit, e.g. ‘g’.
translations

ManyToOneRel to shuup.core.models._units.DisplayUnitTranslation

shopproduct_set

ManyToOneRel to shuup.core.models.ShopProduct

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception DisplayUnit.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

DisplayUnit.internal_unit
DisplayUnit.name

Descriptor for translated attributes.

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

DisplayUnit.objects = <parler.managers.TranslatableManager object>
DisplayUnit.shopproduct_set
DisplayUnit.symbol

Descriptor for translated attributes.

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

DisplayUnit.translations
class shuup.core.models.FixedCostBehaviorComponent(id, polymorphic_ctype, servicebehaviorcomponent_ptr, price_value)

Bases: shuup.core.models._service_base.TranslatableServiceBehaviorComponent

Parameters:
translations

ManyToOneRel to shuup.core.models._service_behavior.FixedCostBehaviorComponentTranslation

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception FixedCostBehaviorComponent.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

FixedCostBehaviorComponent.base_objects = <parler.managers.TranslatableManager object>
FixedCostBehaviorComponent.description

Descriptor for translated attributes.

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

FixedCostBehaviorComponent.get_costs(service, source)[source]
FixedCostBehaviorComponent.help_text = <django.utils.functional.lazy.<locals>.__proxy__ object>
FixedCostBehaviorComponent.name = <django.utils.functional.lazy.<locals>.__proxy__ object>
FixedCostBehaviorComponent.objects = <shuup.core.models._base._PolyTransManager object>
FixedCostBehaviorComponent.polymorphic_primary_key_name = 'id'
FixedCostBehaviorComponent.polymorphic_super_sub_accessors_replaced = False
FixedCostBehaviorComponent.servicebehaviorcomponent_ptr
FixedCostBehaviorComponent.translations
shuup.core.models.get_company_contact(user)

Get preferred CompanyContact of given user.

If user has associated PersonContact which is member of CompanyContact, return CompanyContact. Otherwise, return None.

Parameters:user (django.contrib.auth.models.User|None) – User object (or None) to get contact for
Returns:CompanyContact (or none) of which user’s PersonContact is a member
Return type:CompanyContact|None
shuup.core.models.get_currency_precision(currency)

Get precision by currency code.

Precision values will be populated from the decimal_places fields of the Currency objects in the database.

Parameters:currency (str) – Currency code as 3-letter string (ISO-4217)
Return type:decimal.Decimal|None
Returns:Precision value for given currency code or None for unknown
shuup.core.models.get_person_contact(user)

Get PersonContact of given user.

If given user is non-zero (evaluates true as bool) and not anonymous, return the PersonContact of the user. If there is no PersonContact for the user yet, create it first. When this creation happens, details (name, email, is_active) are copied from the user.

If given user is None (or otherwise evaluates as false) or anonymous, return the AnonymousContact.

Parameters:user (django.contrib.auth.models.User|None) – User object (or None) to get contact for
Returns:PersonContact of the user or AnonymousContact
Return type:PersonContact|AnonymousContact
class shuup.core.models.Gender

Bases: enumfields.enums.Enum

An enumeration.

FEMALE = <Gender.FEMALE: 'f'>
MALE = <Gender.MALE: 'm'>
OTHER = <Gender.OTHER: 'o'>
UNDISCLOSED = <Gender.UNDISCLOSED: 'u'>
class shuup.core.models.GroupAvailabilityBehaviorComponent(id, polymorphic_ctype, servicebehaviorcomponent_ptr)

Bases: shuup.core.models.ServiceBehaviorComponent

Parameters:
exception DoesNotExist

Bases: shuup.core.models._service_base.DoesNotExist

exception GroupAvailabilityBehaviorComponent.MultipleObjectsReturned

Bases: shuup.core.models._service_base.MultipleObjectsReturned

GroupAvailabilityBehaviorComponent.base_objects = <django.db.models.manager.Manager object>
GroupAvailabilityBehaviorComponent.get_unavailability_reasons(service, source)[source]
GroupAvailabilityBehaviorComponent.groups
GroupAvailabilityBehaviorComponent.help_text = <django.utils.functional.lazy.<locals>.__proxy__ object>
GroupAvailabilityBehaviorComponent.name = <django.utils.functional.lazy.<locals>.__proxy__ object>
GroupAvailabilityBehaviorComponent.objects = <polymorphic.managers.PolymorphicManager object>
GroupAvailabilityBehaviorComponent.polymorphic_primary_key_name = 'id'
GroupAvailabilityBehaviorComponent.polymorphic_super_sub_accessors_replaced = False
GroupAvailabilityBehaviorComponent.servicebehaviorcomponent_ptr
class shuup.core.models.ImmutableAddress(*args, **kwargs)

Bases: shuup.core.models._base.ChangeProtected, shuup.core.models._addresses.Address

An address that can not be changed.

Immutable addresses are used for orders, etc., where subsequent edits to the original address (for example an user’s default address) must not affect past business data.

Immutable addresses can be created directly, with the from_data() method, or by creating an immutable copy of an existing MutableAddress with the Address.to_immutable() method.

Parameters:
  • id (AutoField) – Id
  • prefix (CharField) – The name prefix. For example, Mr, Mrs, Ms, Dr, etc.
  • name (CharField) – The name for the address.
  • suffix (CharField) – The name suffix. For example, Jr, Sr, etc.
  • name_ext (CharField) – Any other text to display along with the address. This could be department names (for companies) or titles (for people).
  • company_name (CharField) – The company name for the address.
  • tax_number (CharField) – The business tax number. For example, EIN in US or VAT code in Europe.
  • phone (CharField) – The primary phone number for the address.
  • email (EmailField) – The primary email for the address.
  • street (CharField) – The street address.
  • street2 (CharField) – An additional street address line.
  • street3 (CharField) – Any additional street address line.
  • postal_code (CharField) – The address postal/zip code.
  • city (CharField) – The address city.
  • region_code (CharField) – The address region, province, or state.
  • region (CharField) – The address region, province, or state.
  • country (CountryField) – The address country.
  • longitude (DecimalField) – Longitude
  • latitude (DecimalField) – Latitude
billing_orders

ManyToOneRel to shuup.core.models.Order

shipping_orders

ManyToOneRel to shuup.core.models.Order

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception ImmutableAddress.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

ImmutableAddress.billing_orders
ImmutableAddress.country

A descriptor for country fields on a model instance. Returns a Country when accessed so you can do things like:

>>> from people import Person
>>> person = Person.object.get(name='Chris')

>>> person.country.name
'New Zealand'

>>> person.country.flag
'/static/flags/nz.gif'
classmethod ImmutableAddress.from_data(data)[source]

Get or create immutable address with given data.

Parameters:data (dict[str,str]) – data for address
Returns:Saved immutable address
Return type:ImmutableAddress
ImmutableAddress.get_country_display(*moreargs, **morekwargs)
ImmutableAddress.objects = <django.db.models.manager.Manager object>
ImmutableAddress.shipping_orders
ImmutableAddress.to_immutable()[source]
class shuup.core.models.Manufacturer(id, created_on, identifier, name, url)

Bases: django.db.models.base.Model

Parameters:
  • id (AutoField) – Id
  • created_on (DateTimeField) – Added
  • identifier (InternalIdentifierField) – Do not change this value if you are not sure what you are doing.
  • name (CharField) – Enter the manufacturer’s name. Products can be filtered by the manufacturer and can be useful for inventory and stock management.
  • url (CharField) – Enter the URL of the product manufacturer if you would like customers to be able to visit the manufacturer’s website.
product_set

ManyToOneRel to shuup.core.models.Product

log_entries

ManyToOneRel to shuup.core.models._manufacturers.ManufacturerLogEntry

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception Manufacturer.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

Manufacturer.add_log_entry(message, identifier=None, kind=<LogEntryKind.OTHER: 0>, user=None, extra=None, save=True)
Manufacturer.get_next_by_created_on(*moreargs, **morekwargs)
Manufacturer.get_previous_by_created_on(*moreargs, **morekwargs)
Manufacturer.log_entries
Manufacturer.objects = <django.db.models.manager.Manager object>
Manufacturer.product_set
class shuup.core.models.MutableAddress(*args, **kwargs)

Bases: shuup.core.models._addresses.Address

An address that can be changed.

Mutable addresses are used for e.g. contact’s saved addresses. They are saved as new immutable addresses when used in e.g. orders.

Mutable addresses can be created with MutableAddress.from_data or with the to_mutable method of Address objects.

Parameters:
  • id (AutoField) – Id
  • prefix (CharField) – The name prefix. For example, Mr, Mrs, Ms, Dr, etc.
  • name (CharField) – The name for the address.
  • suffix (CharField) – The name suffix. For example, Jr, Sr, etc.
  • name_ext (CharField) – Any other text to display along with the address. This could be department names (for companies) or titles (for people).
  • company_name (CharField) – The company name for the address.
  • tax_number (CharField) – The business tax number. For example, EIN in US or VAT code in Europe.
  • phone (CharField) – The primary phone number for the address.
  • email (EmailField) – The primary email for the address.
  • street (CharField) – The street address.
  • street2 (CharField) – An additional street address line.
  • street3 (CharField) – Any additional street address line.
  • postal_code (CharField) – The address postal/zip code.
  • city (CharField) – The address city.
  • region_code (CharField) – The address region, province, or state.
  • region (CharField) – The address region, province, or state.
  • country (CountryField) – The address country.
  • longitude (DecimalField) – Longitude
  • latitude (DecimalField) – Latitude
saved_addresses

ManyToOneRel to shuup.core.models.SavedAddress

shop_set

ManyToOneRel to shuup.core.models.Shop

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MutableAddress.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

MutableAddress.country

A descriptor for country fields on a model instance. Returns a Country when accessed so you can do things like:

>>> from people import Person
>>> person = Person.object.get(name='Chris')

>>> person.country.name
'New Zealand'

>>> person.country.flag
'/static/flags/nz.gif'
classmethod MutableAddress.from_data(data)[source]

Construct mutable address from a data dictionary.

Parameters:data (dict[str,str]) – data for address
Returns:Unsaved mutable address
Return type:MutableAddress
MutableAddress.get_country_display(*moreargs, **morekwargs)
MutableAddress.objects = <django.db.models.manager.Manager object>
MutableAddress.saved_addresses
MutableAddress.shop_set
class shuup.core.models.Order(id, shop, created_on, modified_on, identifier, label, key, reference_number, customer, orderer, billing_address, shipping_address, tax_number, phone, email, creator, modified_by, deleted, status, payment_status, shipping_status, payment_method, payment_method_name, payment_data, shipping_method, shipping_method_name, shipping_data, extra_data, taxful_total_price_value, taxless_total_price_value, currency, prices_include_tax, display_currency, display_currency_rate, ip_address, order_date, payment_date, language, customer_comment, admin_comment, require_verification, all_verified, marketing_permission, _codes)

Bases: shuup.utils.properties.MoneyPropped, django.db.models.base.Model

Parameters:
  • id (AutoField) – Id
  • shop (UnsavedForeignKey to shuup.core.models.Shop) – Shop
  • created_on (DateTimeField) – Created on
  • modified_on (DateTimeField) – Modified on
  • identifier (InternalIdentifierField) – Do not change this value if you are not sure what you are doing.
  • label (CharField) – Label
  • key (CharField) – Key
  • reference_number (CharField) – Reference number
  • customer (UnsavedForeignKey to shuup.core.models.Contact) – Customer
  • orderer (UnsavedForeignKey to shuup.core.models.PersonContact) – Orderer
  • billing_address (ForeignKey to shuup.core.models.ImmutableAddress) – Billing address
  • shipping_address (ForeignKey to shuup.core.models.ImmutableAddress) – Shipping address
  • tax_number (CharField) – Tax number
  • phone (CharField) – Phone
  • email (EmailField) – Email address
  • creator (UnsavedForeignKey to django.contrib.auth.models.User) – Creating user
  • modified_by (UnsavedForeignKey to django.contrib.auth.models.User) – Modifier user
  • deleted (BooleanField) – Deleted
  • status (UnsavedForeignKey to shuup.core.models.OrderStatus) – Status
  • payment_status (EnumIntegerField) – Payment status
  • shipping_status (EnumIntegerField) – Shipping status
  • payment_method (UnsavedForeignKey to shuup.core.models.PaymentMethod) – Payment method
  • payment_method_name (CharField) – Payment method name
  • payment_data (JSONField) – Payment data
  • shipping_method (UnsavedForeignKey to shuup.core.models.ShippingMethod) – Shipping method
  • shipping_method_name (CharField) – Shipping method name
  • shipping_data (JSONField) – Shipping data
  • extra_data (JSONField) – Extra data
  • taxful_total_price_value (MoneyValueField) – Grand total
  • taxless_total_price_value (MoneyValueField) – Taxless total
  • currency (CurrencyField) – Currency
  • prices_include_tax (BooleanField) – Prices include tax
  • display_currency (CurrencyField) – Display currency
  • display_currency_rate (DecimalField) – Display currency rate
  • ip_address (GenericIPAddressField) – Ip address
  • order_date (DateTimeField) – Order date
  • payment_date (DateTimeField) – Payment date
  • language (LanguageField) – Language
  • customer_comment (TextField) – Customer comment
  • admin_comment (TextField) – Admin comment/notes
  • require_verification (BooleanField) – Requires verification
  • all_verified (BooleanField) – All lines verified
  • marketing_permission (BooleanField) – Marketing permission
  • _codes (JSONField) – Codes
shipments

ManyToOneRel to shuup.core.models.Shipment

lines

ManyToOneRel to shuup.core.models.OrderLine

log_entries

ManyToOneRel to shuup.core.models.OrderLogEntry

payments

ManyToOneRel to shuup.core.models.Payment

coupon_usages

ManyToOneRel to shuup.campaigns.models.campaigns.CouponUsage

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception Order.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

Order.add_log_entry(message, identifier=None, kind=<LogEntryKind.OTHER: 0>, user=None, extra=None, save=True)
Order.billing_address
Order.cache_prices()[source]
Order.can_create_payment()[source]
Order.can_create_refund()[source]
Order.can_create_shipment()[source]
Order.can_edit()[source]
Order.can_set_canceled()[source]
Order.can_set_complete()[source]
Order.check_all_verified()[source]
Order.codes
Order.coupon_usages
Order.create_full_refund(restock_products=False)[source]

Create a full for entire order contents, with the option of restocking stocked products.

Parameters:restock_products (bool|False) – Boolean indicating whether to restock products
Order.create_payment(amount, payment_identifier=None, description='')[source]

Create a payment with given amount for this order.

If the order already has payments and sum of their amounts is equal or greater than self.taxful_total_price and the order is not a zero price order, an exception is raised.

If the end sum of all payments is equal or greater than self.taxful_total_price, then the order is marked as paid.

Parameters:
  • amount (Money) – Amount of the payment to be created
  • payment_identifier (str|None) – Identifier of the created payment. If not set, default value of “gateway_id:order_id:number” will be used (where number is number of payments in the order).
  • description (str) – Description of the payment. Will be set to method property of the created payment.
Returns:

The created Payment object

Return type:

shuup.core.models.Payment

Order.create_refund(refund_data, created_by=None)[source]

Create a refund if passed a list of refund line data.

Refund line data is simply a list of dictionaries where each dictionary contains data for a particular refund line.

Additionally, if the parent line is of enum type OrderLineType.PRODUCT and the restock_products boolean flag is set to True, the products will be restocked with the order’s supplier the exact amount of the value of the quantity field.

Parameters:
  • refund_data ([dict]) – List of dicts containing refund data.
  • created_by (django.contrib.auth.User|None) – Refund creator’s user instance, used for adjusting supplier stock.
Order.create_shipment(product_quantities, supplier=None, shipment=None)[source]

Create a shipment for this order from product_quantities. product_quantities is expected to be a dict mapping Product instances to quantities.

Only quantities over 0 are taken into account, and if the mapping is empty or has no quantity value over 0, NoProductsToShipException will be raised.

Orders without a shipping address defined, will raise NoShippingAddressException.

Parameters:
  • product_quantities (dict[shuup.shop.models.Product, decimal.Decimal]) – a dict mapping Product instances to quantities to ship
  • supplier – Optional Supplier for this product. No validation is made
  • shipment – Optional unsaved Shipment for ShipmentProduct’s. If not given Shipment is created based on supplier parameter.
Raises:

NoProductsToShipException, NoShippingAddressException

Returns:

Saved, complete Shipment object

Return type:

shuup.core.models.Shipment

Order.create_shipment_of_all_products(supplier=None)[source]

Create a shipment of all the products in this Order, no matter whether or not any have been previously marked as shipped or not.

See the documentation for create_shipment.

Parameters:supplier – The Supplier to use. If None, the first supplier in the order is used. (If several are in the order, this fails.)
Returns:Saved, complete Shipment object
Return type:shuup.shop.models.Shipment
Order.creator
Order.customer
Order.delete(using=None)[source]
Order.extra_data

A placeholder class that provides a way to set the attribute on the model.

Order.full_clean(exclude=None, validate_unique=True)[source]
Order.get_customer_name()[source]
Order.get_known_additional_data()[source]

Get a list of “known additional data” in this order’s payment_data, shipping_data and extra_data. The list is returned in the order the fields are specified in the settings entries for said known keys. dict(that_list) can of course be used to “flatten” the list into a dict. :return: list of 2-tuples.

Order.get_language_display(*moreargs, **morekwargs)
Order.get_next_by_created_on(*moreargs, **morekwargs)
Order.get_next_by_modified_on(*moreargs, **morekwargs)
Order.get_next_by_order_date(*moreargs, **morekwargs)
Order.get_payment_method_display()[source]
Order.get_payment_status_display(*moreargs, **morekwargs)
Order.get_previous_by_created_on(*moreargs, **morekwargs)
Order.get_previous_by_modified_on(*moreargs, **morekwargs)
Order.get_previous_by_order_date(*moreargs, **morekwargs)
Order.get_product_ids_and_quantities()[source]
Order.get_product_summary()[source]

Return a dict of product IDs -> {ordered, unshipped, refunded, shipped}

Order.get_purchased_attachments()[source]
Order.get_shipping_method_display()[source]
Order.get_shipping_status_display(*moreargs, **morekwargs)
Order.get_status_display()[source]
Order.get_tax_summary()[source]
Return type:taxing.TaxSummary
Order.get_total_paid_amount()[source]
Order.get_total_refunded_amount()[source]
Order.get_total_unpaid_amount()[source]
Order.get_total_unrefunded_amount()[source]
Order.get_total_unrefunded_quantity()[source]
Order.get_tracking_codes()[source]
Order.get_unshipped_products()[source]
Order.has_products()[source]
Order.has_refunds()[source]
Order.is_canceled()[source]
Order.is_complete()[source]
Order.is_deferred()[source]
Order.is_fully_shipped()[source]
Order.is_not_paid()[source]
Order.is_paid()[source]
Order.is_partially_paid()[source]
Order.is_partially_shipped()[source]
Order.lines
Order.log_entries
Order.modified_by
Order.objects = <django.db.models.manager.ManagerFromOrderQuerySet object>
Order.orderer
Order.payment_data

A placeholder class that provides a way to set the attribute on the model.

Order.payment_method
Order.payment_status

A placeholder class that provides a way to set the attribute on the model.

Order.payments
Order.save(*args, **kwargs)[source]
Order.set_canceled()[source]
Order.shipments
Order.shipping_address
Order.shipping_data

A placeholder class that provides a way to set the attribute on the model.

Order.shipping_method
Order.shipping_status

A placeholder class that provides a way to set the attribute on the model.

Order.shop
Order.status
Order.taxful_total_price
Order.taxless_total_price
Order.update_payment_status()[source]
Order.update_shipping_status()[source]
class shuup.core.models.OrderLine(id, product, supplier, parent_line, ordering, type, sku, text, accounting_identifier, require_verification, verified, extra_data, quantity, base_unit_price_value, discount_amount_value, order)

Bases: shuup.core.utils.line_unit_mixin.LineWithUnit, shuup.core.models.AbstractOrderLine

Parameters:
  • id (AutoField) – Id
  • product (UnsavedForeignKey to shuup.core.models.Product) – Product
  • supplier (UnsavedForeignKey to shuup.core.models.Supplier) – Supplier
  • parent_line (UnsavedForeignKey to shuup.core.models.OrderLine) – Parent line
  • ordering (IntegerField) – Ordering
  • type (EnumIntegerField) – Line type
  • sku (CharField) – Line sku
  • text (CharField) – Line text
  • accounting_identifier (CharField) – Accounting identifier
  • require_verification (BooleanField) – Require verification
  • verified (BooleanField) – Verified
  • extra_data (JSONField) – Extra data
  • quantity (QuantityField) – Quantity
  • base_unit_price_value (MoneyValueField) – Unit price amount (undiscounted)
  • discount_amount_value (MoneyValueField) – Total amount of discount
  • order (UnsavedForeignKey to shuup.core.models.Order) – Order
child_lines

ManyToOneRel to shuup.core.models.OrderLine

taxes

ManyToOneRel to shuup.core.models.OrderLineTax

log_entries

ManyToOneRel to shuup.core.models._order_lines.OrderLineLogEntry

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception OrderLine.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

OrderLine.add_log_entry(message, identifier=None, kind=<LogEntryKind.OTHER: 0>, user=None, extra=None, save=True)
OrderLine.child_lines
OrderLine.extra_data

A placeholder class that provides a way to set the attribute on the model.

OrderLine.get_type_display(*moreargs, **morekwargs)
OrderLine.log_entries
OrderLine.objects = <shuup.core.models._order_lines.OrderLineManager object>
OrderLine.order
OrderLine.parent_line
OrderLine.product
OrderLine.shop
OrderLine.supplier
OrderLine.taxes
OrderLine.type

A placeholder class that provides a way to set the attribute on the model.

class shuup.core.models.OrderLineTax(id, order_line, tax, name, amount_value, base_amount_value, ordering)

Bases: shuup.utils.properties.MoneyPropped, shuup.core.models.ShuupModel, shuup.core.taxing.LineTax

Parameters:
log_entries

ManyToOneRel to shuup.core.models._order_lines.OrderLineTaxLogEntry

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception OrderLineTax.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

OrderLineTax.add_log_entry(message, identifier=None, kind=<LogEntryKind.OTHER: 0>, user=None, extra=None, save=True)
OrderLineTax.amount

Property for a Money amount.

Will return Money objects when the property is being get and accepts Money objects on set. Value and currency are read/written from/to other fields.

Fields are given as locators, that is a string in dotted format, e.g. locator "foo.bar" points to instance.foo.bar where instance is an instance of the class owning the MoneyProperty.

Setting value of this property to a Money object with different currency that is currently set (in the field pointed by the currency locator), will raise an UnitMixupError.

OrderLineTax.base_amount

Property for a Money amount.

Will return Money objects when the property is being get and accepts Money objects on set. Value and currency are read/written from/to other fields.

Fields are given as locators, that is a string in dotted format, e.g. locator "foo.bar" points to instance.foo.bar where instance is an instance of the class owning the MoneyProperty.

Setting value of this property to a Money object with different currency that is currently set (in the field pointed by the currency locator), will raise an UnitMixupError.

OrderLineTax.log_entries
OrderLineTax.objects = <django.db.models.manager.Manager object>
OrderLineTax.order_line
OrderLineTax.tax
class shuup.core.models.OrderLineType

Bases: enumfields.enums.Enum

An enumeration.

DISCOUNT = <OrderLineType.DISCOUNT: 4>
OTHER = <OrderLineType.OTHER: 5>
PAYMENT = <OrderLineType.PAYMENT: 3>
PRODUCT = <OrderLineType.PRODUCT: 1>
REFUND = <OrderLineType.REFUND: 6>
ROUNDING = <OrderLineType.ROUNDING: 7>
SHIPPING = <OrderLineType.SHIPPING: 2>
class shuup.core.models.OrderLogEntry(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.core.models.Order) – Target
exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception OrderLogEntry.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

OrderLogEntry.extra

A placeholder class that provides a way to set the attribute on the model.

OrderLogEntry.get_kind_display(*moreargs, **morekwargs)
OrderLogEntry.get_next_by_created_on(*moreargs, **morekwargs)
OrderLogEntry.get_previous_by_created_on(*moreargs, **morekwargs)
OrderLogEntry.kind

A placeholder class that provides a way to set the attribute on the model.

OrderLogEntry.logged_model

alias of Order

OrderLogEntry.objects = <django.db.models.manager.Manager object>
OrderLogEntry.target
OrderLogEntry.user
class shuup.core.models.OrderStatus(id, identifier, ordering, role, default, is_active)

Bases: parler.models.TranslatableModel

Parameters:
  • id (AutoField) – Id
  • identifier (InternalIdentifierField) – Internal identifier for status. This is used to identify the statuses in Shuup.
  • ordering (IntegerField) – The processing order of statuses. Default is always processed first.
  • role (EnumIntegerField) – Role of status. One role can have multiple order statuses.
  • default (BooleanField) – Defines if the status should be considered as default.
  • is_active (BooleanField) – Define if the status is usable.
  • name (CharField) – (Translatable) Name of the order status
  • public_name (CharField) – (Translatable) The name shown for customer in shop front.
translations

ManyToOneRel to shuup.core.models._orders.OrderStatusTranslation

order_set

ManyToOneRel to shuup.core.models.Order

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception OrderStatus.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

OrderStatus.get_role_display(*moreargs, **morekwargs)
OrderStatus.name

Descriptor for translated attributes.

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

OrderStatus.objects = <django.db.models.manager.ManagerFromOrderStatusQuerySet object>
OrderStatus.order_set
OrderStatus.public_name

Descriptor for translated attributes.

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

OrderStatus.role

A placeholder class that provides a way to set the attribute on the model.

OrderStatus.save(*args, **kwargs)[source]
OrderStatus.translations
class shuup.core.models.OrderStatusManager

Bases: object

ensure_default_statuses()[source]

Ensure Default Statuses

It is important to ensure that default statuses are always available. This method will ensure that

is_default(status_object)[source]
class shuup.core.models.OrderStatusRole

Bases: enumfields.enums.Enum

An enumeration.

CANCELED = <OrderStatusRole.CANCELED: 3>
COMPLETE = <OrderStatusRole.COMPLETE: 2>
INITIAL = <OrderStatusRole.INITIAL: 1>
NONE = <OrderStatusRole.NONE: 0>
PROCESSING = <OrderStatusRole.PROCESSING: 4>
class shuup.core.models.OrderTotalLimitBehaviorComponent(id, polymorphic_ctype, servicebehaviorcomponent_ptr, min_price_value, max_price_value)

Bases: shuup.core.models.ServiceBehaviorComponent

Parameters:
exception DoesNotExist

Bases: shuup.core.models._service_base.DoesNotExist

exception OrderTotalLimitBehaviorComponent.MultipleObjectsReturned

Bases: shuup.core.models._service_base.MultipleObjectsReturned

OrderTotalLimitBehaviorComponent.base_objects = <django.db.models.manager.Manager object>
OrderTotalLimitBehaviorComponent.get_unavailability_reasons(service, source)[source]
OrderTotalLimitBehaviorComponent.help_text = <django.utils.functional.lazy.<locals>.__proxy__ object>
OrderTotalLimitBehaviorComponent.name = <django.utils.functional.lazy.<locals>.__proxy__ object>
OrderTotalLimitBehaviorComponent.objects = <polymorphic.managers.PolymorphicManager object>
OrderTotalLimitBehaviorComponent.polymorphic_primary_key_name = 'id'
OrderTotalLimitBehaviorComponent.polymorphic_super_sub_accessors_replaced = False
OrderTotalLimitBehaviorComponent.servicebehaviorcomponent_ptr
class shuup.core.models.Payment(id, created_on, gateway_id, payment_identifier, amount_value, foreign_amount_value, foreign_currency, description, order)

Bases: shuup.core.models.AbstractPayment

Parameters:
  • id (AutoField) – Id
  • created_on (DateTimeField) – Created on
  • gateway_id (CharField) – Gateway id
  • payment_identifier (CharField) – Identifier
  • amount_value (MoneyValueField) – Amount
  • foreign_amount_value (MoneyValueField) – Foreign amount
  • foreign_currency (CurrencyField) – Foreign amount currency
  • description (CharField) – Description
  • order (ForeignKey to shuup.core.models.Order) – Order
log_entries

ManyToOneRel to shuup.core.models._payments.PaymentLogEntry

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception Payment.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

Payment.add_log_entry(message, identifier=None, kind=<LogEntryKind.OTHER: 0>, user=None, extra=None, save=True)
Payment.currency
Payment.get_next_by_created_on(*moreargs, **morekwargs)
Payment.get_previous_by_created_on(*moreargs, **morekwargs)
Payment.log_entries
Payment.objects = <django.db.models.manager.Manager object>
Payment.order
class shuup.core.models.PaymentMethod(id, identifier, enabled, shop, choice_identifier, old_module_identifier, old_module_data, logo, tax_class, payment_processor)

Bases: shuup.core.models.Service

Parameters:
  • id (AutoField) – Id
  • identifier (InternalIdentifierField) – Do not change this value if you are not sure what you are doing.
  • enabled (BooleanField) – Check this if this service is selectable on checkout.
  • shop (ForeignKey to shuup.core.models.Shop) – The shop for this service.
  • choice_identifier (CharField) – Choice identifier
  • old_module_identifier (CharField) – Old module identifier
  • old_module_data (JSONField) – Old module data
  • logo (FilerImageField to filer.models.imagemodels.Image) – Logo
  • tax_class (ForeignKey to shuup.core.models.TaxClass) – The tax class to use for this service. Tax classes are defined in Settings - Tax Classes.
  • payment_processor (ForeignKey to shuup.core.models.PaymentProcessor) – Payment processor
  • behavior_components (ManyToManyField to shuup.core.models.ServiceBehaviorComponent) – Behavior components
  • name (CharField) – (Translatable) The payment method name. This name is shown to customers on checkout.
  • description (CharField) – (Translatable) The payment method description. This description is shown to customers on checkout.
payment_orders

ManyToOneRel to shuup.core.models.Order

contact_set

ManyToOneRel to shuup.core.models.Contact

translations

ManyToOneRel to shuup.core.models._service_payment.PaymentMethodTranslation

log_entries

ManyToOneRel to shuup.core.models._service_payment.PaymentMethodLogEntry

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception PaymentMethod.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

PaymentMethod.add_log_entry(message, identifier=None, kind=<LogEntryKind.OTHER: 0>, user=None, extra=None, save=True)
PaymentMethod.behavior_components
PaymentMethod.can_delete()[source]
PaymentMethod.contact_set
PaymentMethod.description

Descriptor for translated attributes.

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

PaymentMethod.get_payment_process_response(order, urls)[source]
PaymentMethod.line_type = <OrderLineType.PAYMENT: 3>
PaymentMethod.log_entries
PaymentMethod.name

Descriptor for translated attributes.

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

PaymentMethod.objects = <django.db.models.manager.ManagerFromServiceQuerySet object>
PaymentMethod.old_module_data

A placeholder class that provides a way to set the attribute on the model.

PaymentMethod.payment_orders
PaymentMethod.payment_processor
PaymentMethod.payment_products
PaymentMethod.process_payment_return_request(order, request)[source]
PaymentMethod.provider_attr = 'payment_processor'
PaymentMethod.shop
PaymentMethod.shop_product_m2m = 'payment_methods'
PaymentMethod.tax_class
PaymentMethod.translations
class shuup.core.models.PaymentProcessor(*args, **kwargs)

Bases: shuup.core.models.ServiceProvider

Service provider interface for payment processing.

Services provided by a payment processor are payment methods. To create a new payment method for a payment processor, use the create_service method.

Implementers of this interface will provide provide a list of payment service choices and each related payment method should have one of those service choices assigned to it.

Payment processing is handled with get_payment_process_response and process_payment_return_request methods.

Note: PaymentProcessor objects should never be created on their own but rather through a concrete subclass.

Parameters:
  • id (AutoField) – Id
  • polymorphic_ctype (ForeignKey to django.contrib.contenttypes.models.ContentType) – Polymorphic ctype
  • identifier (InternalIdentifierField) – Do not change this value if you are not sure what you are doing.
  • enabled (BooleanField) – Check this if this service provider can be used when placing orders
  • logo (FilerImageField to filer.models.imagemodels.Image) – Logo
  • serviceprovider_ptr (OneToOneField to shuup.core.models.ServiceProvider) – Serviceprovider ptr
  • name (CharField) – (Translatable) The service provider name.
base_translations

ManyToOneRel to shuup.core.models._service_base.ServiceProviderTranslation

paymentmethod_set

ManyToOneRel to shuup.core.models.PaymentMethod

custompaymentprocessor_set

OneToOneRel to shuup.core.models.CustomPaymentProcessor

log_entries

ManyToOneRel to shuup.core.models._service_payment.PaymentProcessorLogEntry

pseudopaymentprocessor_set

OneToOneRel to shuup.testing.models._pseudo_payment.PseudoPaymentProcessor

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
  • identifier (InternalIdentifierField) – Do not change this value if you are not sure what you are doing.
  • enabled (BooleanField) – Check this if this service provider can be used when placing orders
  • logo (FilerImageField to filer.models.imagemodels.Image) – Logo
  • serviceprovider_ptr (OneToOneField to shuup.core.models.ServiceProvider) – Serviceprovider ptr
  • name (CharField) – (Translatable) The service provider name.
base_translations

ManyToOneRel to shuup.core.models._service_base.ServiceProviderTranslation

paymentmethod_set

ManyToOneRel to shuup.core.models.PaymentMethod

custompaymentprocessor_set

OneToOneRel to shuup.core.models.CustomPaymentProcessor

log_entries

ManyToOneRel to shuup.core.models._service_payment.PaymentProcessorLogEntry

pseudopaymentprocessor_set

OneToOneRel to shuup.testing.models._pseudo_payment.PseudoPaymentProcessor

exception DoesNotExist

Bases: shuup.core.models._service_base.DoesNotExist

exception PaymentProcessor.MultipleObjectsReturned

Bases: shuup.core.models._service_base.MultipleObjectsReturned

PaymentProcessor.add_log_entry(message, identifier=None, kind=<LogEntryKind.OTHER: 0>, user=None, extra=None, save=True)
PaymentProcessor.base_objects = <parler.managers.TranslatableManager object>
PaymentProcessor.custompaymentprocessor
PaymentProcessor.delete(*args, **kwargs)[source]
PaymentProcessor.get_payment_process_response(service, order, urls)[source]

Get payment process response for given order.

Return type:django.http.HttpResponse|None
PaymentProcessor.log_entries
PaymentProcessor.objects = <shuup.core.models._base._PolyTransManager object>
PaymentProcessor.paymentmethod_set
PaymentProcessor.polymorphic_primary_key_name = 'id'
PaymentProcessor.polymorphic_super_sub_accessors_replaced = False
PaymentProcessor.process_payment_return_request(service, order, request)[source]

Process payment return request for given order.

Should set order.payment_status. Default implementation just sets it to DEFERRED if it is NOT_PAID.

Return type:None
PaymentProcessor.pseudopaymentprocessor
PaymentProcessor.service_model

alias of PaymentMethod

PaymentProcessor.serviceprovider_ptr
class shuup.core.models.PaymentStatus

Bases: enumfields.enums.Enum

An enumeration.

CANCELED = <PaymentStatus.CANCELED: 3>
DEFERRED = <PaymentStatus.DEFERRED: 4>
FULLY_PAID = <PaymentStatus.FULLY_PAID: 2>
NOT_PAID = <PaymentStatus.NOT_PAID: 0>
PARTIALLY_PAID = <PaymentStatus.PARTIALLY_PAID: 1>
class shuup.core.models.PaymentUrls(payment_url, return_url, cancel_url)

Bases: object

Container for URLs used in payment processing.

class shuup.core.models.PersistentCacheEntry(id, module, key, time, data)

Bases: django.db.models.base.Model

Parameters:
  • id (AutoField) – Id
  • module (CharField) – Module
  • key (CharField) – Key
  • time (DateTimeField) – Time
  • data (JSONField) – Data
exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception PersistentCacheEntry.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

PersistentCacheEntry.data

A placeholder class that provides a way to set the attribute on the model.

PersistentCacheEntry.get_next_by_time(*moreargs, **morekwargs)
PersistentCacheEntry.get_previous_by_time(*moreargs, **morekwargs)
PersistentCacheEntry.objects = <django.db.models.manager.Manager object>
class shuup.core.models.PersonContact(id, polymorphic_ctype, created_on, identifier, is_active, default_shipping_address, default_billing_address, default_shipping_method, default_payment_method, _language, marketing_permission, phone, www, timezone, prefix, name, suffix, name_ext, email, tax_group, merchant_notes, account_manager, contact_ptr, user, gender, birth_date, first_name, last_name)

Bases: shuup.core.models.Contact

Parameters:
  • id (AutoField) – Id
  • polymorphic_ctype (ForeignKey to django.contrib.contenttypes.models.ContentType) – Polymorphic ctype
  • created_on (DateTimeField) – Created on
  • identifier (InternalIdentifierField) – Do not change this value if you are not sure what you are doing.
  • is_active (BooleanField) – Check this if the contact is an active customer.
  • default_shipping_address (ForeignKey to shuup.core.models.MutableAddress) – Shipping address
  • default_billing_address (ForeignKey to shuup.core.models.MutableAddress) – Billing address
  • default_shipping_method (ForeignKey to shuup.core.models.ShippingMethod) – Default shipping method
  • default_payment_method (ForeignKey to shuup.core.models.PaymentMethod) – Default payment method
  • _language (LanguageField) – The primary language to be used in all communications with the contact.
  • marketing_permission (BooleanField) – Check this if the contact can receive marketing and promotional materials.
  • phone (CharField) – The primary phone number of the contact.
  • www (URLField) – The web address of the contact, if any.
  • timezone (TimeZoneField) – The timezone in which the contact resides. This can be used to target the delivery of promotional materials at a particular time.
  • prefix (CharField) – The name prefix of the contact. For example, Mr, Mrs, Dr, etc.
  • name (CharField) – The contact name
  • suffix (CharField) – The name suffix of the contact. For example, Sr, Jr, etc.
  • name_ext (CharField) – Name extension
  • email (EmailField) – The email that will receive order confirmations and promotional materials (if permitted).
  • tax_group (ForeignKey to shuup.core.models.CustomerTaxGroup) – Select the contact tax group to use for this contact. Tax groups can be used to customize the tax rules the that apply to any of this contacts orders. Tax groups are defined in Settings - Customer Tax Groups and can be applied to tax rules in Settings - Tax Rules
  • merchant_notes (TextField) – Enter any private notes for this customer that are only accessible in Shuup admin.
  • account_manager (ForeignKey to shuup.core.models.PersonContact) – Account manager
  • contact_ptr (OneToOneField to shuup.core.models.Contact) – Contact ptr
  • user (OneToOneField to django.contrib.auth.models.User) – User
  • gender (EnumField) – The gender of the contact.
  • birth_date (DateField) – The birth date of the contact.
  • first_name (CharField) – The first name of the contact.
  • last_name (CharField) – The last name of the contact.
savedaddress_set

ManyToOneRel to shuup.core.models.SavedAddress

customer_core_baskets

ManyToOneRel to shuup.core.models.Basket

customer_orders

ManyToOneRel to shuup.core.models.Order

shop_set

ManyToOneRel to shuup.core.models.Shop

customer_baskets

ManyToOneRel to shuup.front.models.stored_basket.StoredBasket

orderer_core_baskets

ManyToOneRel to shuup.core.models.Basket

orderer_orders

ManyToOneRel to shuup.core.models.Order

contact_set

ManyToOneRel to shuup.core.models.Contact

log_entries

ManyToOneRel to shuup.core.models._contacts.PersonContactLogEntry

orderer_baskets

ManyToOneRel to shuup.front.models.stored_basket.StoredBasket

exception DoesNotExist

Bases: shuup.core.models._contacts.DoesNotExist

exception PersonContact.MultipleObjectsReturned

Bases: shuup.core.models._contacts.MultipleObjectsReturned

PersonContact.add_log_entry(message, identifier=None, kind=<LogEntryKind.OTHER: 0>, user=None, extra=None, save=True)
PersonContact.base_objects = <django.db.models.manager.Manager object>
PersonContact.contact_ptr
PersonContact.contact_set
PersonContact.default_contact_group_identifier = 'default_person_group'
PersonContact.default_contact_group_name = <django.utils.functional.lazy.<locals>.__proxy__ object>
PersonContact.default_tax_group_getter()
PersonContact.gender

A placeholder class that provides a way to set the attribute on the model.

PersonContact.get_gender_display(*moreargs, **morekwargs)
PersonContact.is_all_seeing
PersonContact.log_entries
PersonContact.name
PersonContact.objects = <polymorphic.managers.PolymorphicManager object>
PersonContact.orderer_baskets
PersonContact.orderer_core_baskets
PersonContact.orderer_orders
PersonContact.polymorphic_primary_key_name = 'id'
PersonContact.polymorphic_super_sub_accessors_replaced = False
PersonContact.save(*args, **kwargs)[source]
PersonContact.user
class shuup.core.models.PiecesSalesUnit

Bases: shuup.core.models.SalesUnit

Object representing Pieces sales unit.

Has same API as SalesUnit, but isn’t a real model.

Parameters:
  • id (AutoField) – Id
  • identifier (InternalIdentifierField) – Do not change this value if you are not sure what you are doing.
  • decimals (PositiveSmallIntegerField) – The number of decimal places allowed by this sales unit.Set this to a value greater than zero if products with this sales unit can be sold in fractional quantities
  • salesunit_ptr (OneToOneField to shuup.core.models.SalesUnit) – Salesunit ptr
  • name (CharField) – (Translatable) The sales unit name to use for products (For example, ‘pieces’ or ‘units’). Sales units can be set for each product through the product editor view.
  • symbol (CharField) – (Translatable) An abbreviated name for this sales unit that is shown throughout admin and order invoices.
translations

ManyToOneRel to shuup.core.models._units.SalesUnitTranslation

display_units

ManyToOneRel to shuup.core.models.DisplayUnit

product_set

ManyToOneRel to shuup.core.models.Product

class Meta[source]

Bases: object

abstract = False
PiecesSalesUnit.display_unit
PiecesSalesUnit.name = <django.utils.functional.lazy.<locals>.__proxy__ object>
PiecesSalesUnit.objects
PiecesSalesUnit.pk
PiecesSalesUnit.salesunit_ptr
PiecesSalesUnit.symbol = 'pc.'
class shuup.core.models.PolymorphicShuupModel(*args, **kwargs)

Bases: polymorphic.models.PolymorphicModel, shuup.core.models.ShuupModel

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:polymorphic_ctype (ForeignKey to django.contrib.contenttypes.models.ContentType) – Polymorphic ctype
class Meta[source]

Bases: object

abstract = False
PolymorphicShuupModel.base_objects
PolymorphicShuupModel.objects
PolymorphicShuupModel.polymorphic_ctype
PolymorphicShuupModel.polymorphic_super_sub_accessors_replaced = False
class shuup.core.models.PolymorphicTranslatableShuupModel(*args, **kwargs)

Bases: shuup.core.models.PolymorphicShuupModel, shuup.core.models.TranslatableShuupModel

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:polymorphic_ctype (ForeignKey to django.contrib.contenttypes.models.ContentType) – Polymorphic ctype
class Meta[source]

Bases: object

abstract = False
PolymorphicTranslatableShuupModel.base_objects
PolymorphicTranslatableShuupModel.objects
PolymorphicTranslatableShuupModel.polymorphic_ctype
PolymorphicTranslatableShuupModel.polymorphic_super_sub_accessors_replaced = False
class shuup.core.models.Product(id, created_on, modified_on, deleted, mode, variation_parent, stock_behavior, shipping_mode, sales_unit, tax_class, type, sku, gtin, barcode, accounting_identifier, profit_center, cost_center, width, height, depth, net_weight, gross_weight, manufacturer, primary_image)

Bases: shuup.core.taxing.TaxableItem, shuup.core.models._attributes.AttributableMixin, parler.models.TranslatableModel

Parameters:
  • id (AutoField) – Id
  • created_on (DateTimeField) – Created on
  • modified_on (DateTimeField) – Modified on
  • deleted (BooleanField) – Deleted
  • mode (EnumIntegerField) – Mode
  • variation_parent (ForeignKey to shuup.core.models.Product) – Variation parent
  • stock_behavior (EnumIntegerField) – Set to stocked if inventory should be managed within Shuup.
  • shipping_mode (EnumIntegerField) – Set to shipped if the product requires shipment.
  • sales_unit (ForeignKey to shuup.core.models.SalesUnit) – Select a sales unit for your product. This is shown in your store front and is used to determine whether the product can be purchased using fractional amounts. Sales units are defined in Products - Sales Units.
  • tax_class (ForeignKey to shuup.core.models.TaxClass) – Select a tax class for your product. The tax class is used to determine which taxes to apply to your product. Tax classes are defined in Settings - Tax Classes. The rules by which taxes are applied are defined in Settings - Tax Rules.
  • type (ForeignKey to shuup.core.models.ProductType) – Select a product type for your product. These allow you to configure custom attributes to help with classification and analysis.
  • sku (CharField) – Enter a SKU (Stock Keeping Unit) number for your product. This is a product identification code that helps you track it through your inventory. People often use the number by the barcode on the product, but you can set up any numerical system you want to keep track of products.
  • gtin (CharField) – You can enter a Global Trade Item Number. This is typically a 14 digit identification number for all of your trade items. It can often be found by the barcode.
  • barcode (CharField) – You can enter the barcode number for your product. This is useful for inventory/stock tracking and analysis.
  • accounting_identifier (CharField) – Bookkeeping account
  • profit_center (CharField) – Profit center
  • cost_center (CharField) – Cost center
  • width (MeasurementField) – Set the measured width of your product or product packaging. This will provide customers with your product size and help with calculating shipping costs.
  • height (MeasurementField) – Set the measured height of your product or product packaging. This will provide customers with your product size and help with calculating shipping costs.
  • depth (MeasurementField) – Set the measured depth or length of your product or product packaging. This will provide customers with your product size and help with calculating shipping costs.
  • net_weight (MeasurementField) – Set the measured weight of your product WITHOUT its packaging. This will provide customers with your product weight.
  • gross_weight (MeasurementField) – Set the measured gross Weight of your product WITH its packaging. This will help with calculating shipping costs.
  • manufacturer (ForeignKey to shuup.core.models.Manufacturer) – Select a manufacturer for your product. These are defined in Products Settings - Manufacturers
  • primary_image (ForeignKey to shuup.core.models.ProductMedia) – Primary image
  • name (CharField) – (Translatable) Enter a descriptive name for your product. This will be its title in your store.
  • description (TextField) – (Translatable) To make your product stand out, give it an awesome description. This is what will help your shoppers learn about your products. It will also help shoppers find them in the store and on the web.
  • short_description (CharField) – (Translatable) Enter a short description for your product. The short description will be used to get the attention of your customer with a small but precise description of your product.
  • slug (SlugField) – (Translatable) Enter a URL Slug for your product. This is what your product page URL will be. A default will be created using the product name.
  • keywords (TextField) – (Translatable) You can enter keywords that describe your product. This will help your shoppers learn about your products. It will also help shoppers find them in the store and on the web.
  • status_text (CharField) – (Translatable) This text will be shown alongside the product in the shop. It is useful for informing customers of special stock numbers or preorders. (Ex.: “Available in a month”)
  • variation_name (CharField) – (Translatable) You can enter a name for the variation of your product. This could be for example different colors or versions.
shipments

ManyToOneRel to shuup.core.models.ShipmentProduct

order_lines

ManyToOneRel to shuup.core.models.OrderLine

media

ManyToOneRel to shuup.core.models.ProductMedia

variation_variables

ManyToOneRel to shuup.core.models.ProductVariationVariable

variation_result_supers

ManyToOneRel to shuup.core.models.ProductVariationResult

variation_result_subs

ManyToOneRel to shuup.core.models.ProductVariationResult

translations

ManyToOneRel to shuup.core.models._products.ProductTranslation

variation_children

ManyToOneRel to shuup.core.models.Product

log_entries

ManyToOneRel to shuup.core.models._products.ProductLogEntry

cross_sell_1

ManyToOneRel to shuup.core.models.ProductCrossSell

cross_sell_2

ManyToOneRel to shuup.core.models.ProductCrossSell

attributes

ManyToOneRel to shuup.core.models.ProductAttribute

shop_products

ManyToOneRel to shuup.core.models.ShopProduct

suppliedproduct_set

ManyToOneRel to shuup.core.models.SuppliedProduct

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception Product.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

Product.add_log_entry(message, identifier=None, kind=<LogEntryKind.OTHER: 0>, user=None, extra=None, save=True)
Product.attributes
Product.basket_set
Product.clear_variation()[source]

Fully remove variation information.

Make this product a non-variation parent.

Product.cross_sell_1
Product.cross_sell_2
Product.delete(using=None)[source]
Product.description

Descriptor for translated attributes.

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

Product.get_all_available_combinations()[source]

Generate all available combinations of variation variables.

If the product is not a variable variation parent, the iterator is empty.

Because of possible combinatorial explosion this is a generator function. (For example 6 variables with 5 options each explodes to 15,625 combinations.)

Returns:Iterable of combination information dicts.
Return type:Iterable[dict]
Product.get_all_package_children()[source]
Product.get_all_package_parents()[source]
Product.get_available_attribute_queryset()[source]
Product.get_available_variation_results()[source]

Get a dict of combination_hash to product ID of variable variation results.

Returns:Mapping of combination hashes to product IDs
Return type:dict[str, int]
Product.get_base_price(context, quantity=1)[source]

Get base price of the product within given context.

Base price differs from the (effective) price when there are discounts in effect.

Return type:shuup.core.pricing.Price
Product.get_cheapest_child_price(context, quantity=1)[source]
Product.get_cheapest_child_price_info(context, quantity=1)[source]

Get the PriceInfo of the cheapest variation child

The attribute used for sorting is PriceInfo.price.

Return None if self.variation_children do not exist. This is because we cannot return anything sensible.

Return type:shuup.core.pricing.PriceInfo
Product.get_child_price_range(context, quantity=1)[source]

Get the prices for cheapest and the most expensive child

The attribute used for sorting is PriceInfo.price.

Return (None, None) if self.variation_children do not exist. This is because we cannot return anything sensible.

Returns:a tuple of prices
Return type:(shuup.core.pricing.Price, shuup.core.pricing.Price)
Product.get_mode_display(*moreargs, **morekwargs)
Product.get_next_by_created_on(*moreargs, **morekwargs)
Product.get_next_by_modified_on(*moreargs, **morekwargs)
Product.get_package_child_to_quantity_map()[source]
Product.get_previous_by_created_on(*moreargs, **morekwargs)
Product.get_previous_by_modified_on(*moreargs, **morekwargs)
Product.get_price(context, quantity=1)[source]

Get price of the product within given context.

Note

When the current pricing module implements pricing steps, it is possible that p.get_price(ctx) * 123 is not equal to p.get_price(ctx, quantity=123), since there could be quantity discounts in effect, but usually they are equal.

Return type:shuup.core.pricing.Price
Product.get_price_info(context, quantity=1)[source]

Get PriceInfo object for the product in given context.

Returned PriceInfo object contains calculated price and base_price. The calculation of prices is handled in the current pricing module.

Return type:shuup.core.pricing.PriceInfo
Product.get_priced_children(context, quantity=1)[source]

Get child products with price infos sorted by price.

Return type:list[(Product,PriceInfo)]
Returns:List of products and their price infos sorted from cheapest to most expensive.
Product.get_public_media()[source]
Product.get_shipping_mode_display(*moreargs, **morekwargs)
Product.get_shop_instance(shop, allow_cache=False)[source]
Return type:shuup.core.models.ShopProduct
Product.get_stock_behavior_display(*moreargs, **morekwargs)
Product.get_variation_siblings()[source]
Product.is_container()[source]
Product.is_package_child()[source]
Product.is_package_parent()[source]
Product.is_stocked()[source]
Product.is_subscription_parent()[source]
Product.is_variation_child()[source]
Product.is_variation_parent()[source]
Product.keywords

Descriptor for translated attributes.

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

Parameters:
  • parent (Product) – The parent to link to.
  • variables (dict|None) – Optional dict of {variable identifier: value identifier} for complex variable linkage
  • combination_hash (str|None) – Optional combination hash (for variable variations), if precomputed. Mutually exclusive with variables
Product.log_entries
Product.make_package(package_def)[source]
Product.manufacturer
Product.media
Product.mode

A placeholder class that provides a way to set the attribute on the model.

Product.name

Descriptor for translated attributes.

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

Product.objects = <django.db.models.manager.ManagerFromProductQuerySet object>
Product.order_lines
Product.primary_image
Product.sales_unit
Product.save(*args, **kwargs)[source]
Product.shipments
Product.shipping_mode

A placeholder class that provides a way to set the attribute on the model.

Product.shop_products
Product.short_description

Descriptor for translated attributes.

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

Product.simplify_variation()[source]

Remove variation variables from the given variation parent, turning it into a simple variation (or a normal product, if it has no children).

Parameters:product (shuup.core.models.Product) – Variation parent to not be variable any longer.
Product.slug

Descriptor for translated attributes.

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

Product.soft_delete(user=None)[source]
Product.status_text

Descriptor for translated attributes.

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

Product.stock_behavior

A placeholder class that provides a way to set the attribute on the model.

Product.storedbasket_set
Product.suppliedproduct_set
Product.tax_class
Product.translations
Product.type
Product.variation_children
Product.variation_name

Descriptor for translated attributes.

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

Product.variation_parent
Product.variation_result_subs
Product.variation_result_supers
Product.variation_variables
Product.verify_mode()[source]
class shuup.core.models.Product(id, created_on, modified_on, deleted, mode, variation_parent, stock_behavior, shipping_mode, sales_unit, tax_class, type, sku, gtin, barcode, accounting_identifier, profit_center, cost_center, width, height, depth, net_weight, gross_weight, manufacturer, primary_image)

Bases: shuup.core.taxing.TaxableItem, shuup.core.models._attributes.AttributableMixin, parler.models.TranslatableModel

Parameters:
  • id (AutoField) – Id
  • created_on (DateTimeField) – Created on
  • modified_on (DateTimeField) – Modified on
  • deleted (BooleanField) – Deleted
  • mode (EnumIntegerField) – Mode
  • variation_parent (ForeignKey to shuup.core.models.Product) – Variation parent
  • stock_behavior (EnumIntegerField) – Set to stocked if inventory should be managed within Shuup.
  • shipping_mode (EnumIntegerField) – Set to shipped if the product requires shipment.
  • sales_unit (ForeignKey to shuup.core.models.SalesUnit) – Select a sales unit for your product. This is shown in your store front and is used to determine whether the product can be purchased using fractional amounts. Sales units are defined in Products - Sales Units.
  • tax_class (ForeignKey to shuup.core.models.TaxClass) – Select a tax class for your product. The tax class is used to determine which taxes to apply to your product. Tax classes are defined in Settings - Tax Classes. The rules by which taxes are applied are defined in Settings - Tax Rules.
  • type (ForeignKey to shuup.core.models.ProductType) – Select a product type for your product. These allow you to configure custom attributes to help with classification and analysis.
  • sku (CharField) – Enter a SKU (Stock Keeping Unit) number for your product. This is a product identification code that helps you track it through your inventory. People often use the number by the barcode on the product, but you can set up any numerical system you want to keep track of products.
  • gtin (CharField) – You can enter a Global Trade Item Number. This is typically a 14 digit identification number for all of your trade items. It can often be found by the barcode.
  • barcode (CharField) – You can enter the barcode number for your product. This is useful for inventory/stock tracking and analysis.
  • accounting_identifier (CharField) – Bookkeeping account
  • profit_center (CharField) – Profit center
  • cost_center (CharField) – Cost center
  • width (MeasurementField) – Set the measured width of your product or product packaging. This will provide customers with your product size and help with calculating shipping costs.
  • height (MeasurementField) – Set the measured height of your product or product packaging. This will provide customers with your product size and help with calculating shipping costs.
  • depth (MeasurementField) – Set the measured depth or length of your product or product packaging. This will provide customers with your product size and help with calculating shipping costs.
  • net_weight (MeasurementField) – Set the measured weight of your product WITHOUT its packaging. This will provide customers with your product weight.
  • gross_weight (MeasurementField) – Set the measured gross Weight of your product WITH its packaging. This will help with calculating shipping costs.
  • manufacturer (ForeignKey to shuup.core.models.Manufacturer) – Select a manufacturer for your product. These are defined in Products Settings - Manufacturers
  • primary_image (ForeignKey to shuup.core.models.ProductMedia) – Primary image
  • name (CharField) – (Translatable) Enter a descriptive name for your product. This will be its title in your store.
  • description (TextField) – (Translatable) To make your product stand out, give it an awesome description. This is what will help your shoppers learn about your products. It will also help shoppers find them in the store and on the web.
  • short_description (CharField) – (Translatable) Enter a short description for your product. The short description will be used to get the attention of your customer with a small but precise description of your product.
  • slug (SlugField) – (Translatable) Enter a URL Slug for your product. This is what your product page URL will be. A default will be created using the product name.
  • keywords (TextField) – (Translatable) You can enter keywords that describe your product. This will help your shoppers learn about your products. It will also help shoppers find them in the store and on the web.
  • status_text (CharField) – (Translatable) This text will be shown alongside the product in the shop. It is useful for informing customers of special stock numbers or preorders. (Ex.: “Available in a month”)
  • variation_name (CharField) – (Translatable) You can enter a name for the variation of your product. This could be for example different colors or versions.
shipments

ManyToOneRel to shuup.core.models.ShipmentProduct

order_lines

ManyToOneRel to shuup.core.models.OrderLine

media

ManyToOneRel to shuup.core.models.ProductMedia

variation_variables

ManyToOneRel to shuup.core.models.ProductVariationVariable

variation_result_supers

ManyToOneRel to shuup.core.models.ProductVariationResult

variation_result_subs

ManyToOneRel to shuup.core.models.ProductVariationResult

translations

ManyToOneRel to shuup.core.models._products.ProductTranslation

variation_children

ManyToOneRel to shuup.core.models.Product

log_entries

ManyToOneRel to shuup.core.models._products.ProductLogEntry

cross_sell_1

ManyToOneRel to shuup.core.models.ProductCrossSell

cross_sell_2

ManyToOneRel to shuup.core.models.ProductCrossSell

attributes

ManyToOneRel to shuup.core.models.ProductAttribute

shop_products

ManyToOneRel to shuup.core.models.ShopProduct

suppliedproduct_set

ManyToOneRel to shuup.core.models.SuppliedProduct

COMMON_SELECT_RELATED = ('type', 'primary_image', 'tax_class')
exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception Product.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

Product.add_log_entry(message, identifier=None, kind=<LogEntryKind.OTHER: 0>, user=None, extra=None, save=True)
Product.attributes
Product.basket_set
Product.clear_variation()[source]

Fully remove variation information.

Make this product a non-variation parent.

Product.cross_sell_1
Product.cross_sell_2
Product.delete(using=None)[source]
Product.description

Descriptor for translated attributes.

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

Product.get_all_available_combinations()[source]

Generate all available combinations of variation variables.

If the product is not a variable variation parent, the iterator is empty.

Because of possible combinatorial explosion this is a generator function. (For example 6 variables with 5 options each explodes to 15,625 combinations.)

Returns:Iterable of combination information dicts.
Return type:Iterable[dict]
Product.get_all_package_children()[source]
Product.get_all_package_parents()[source]
Product.get_available_attribute_queryset()[source]
Product.get_available_variation_results()[source]

Get a dict of combination_hash to product ID of variable variation results.

Returns:Mapping of combination hashes to product IDs
Return type:dict[str, int]
Product.get_base_price(context, quantity=1)[source]

Get base price of the product within given context.

Base price differs from the (effective) price when there are discounts in effect.

Return type:shuup.core.pricing.Price
Product.get_cheapest_child_price(context, quantity=1)[source]
Product.get_cheapest_child_price_info(context, quantity=1)[source]

Get the PriceInfo of the cheapest variation child

The attribute used for sorting is PriceInfo.price.

Return None if self.variation_children do not exist. This is because we cannot return anything sensible.

Return type:shuup.core.pricing.PriceInfo
Product.get_child_price_range(context, quantity=1)[source]

Get the prices for cheapest and the most expensive child

The attribute used for sorting is PriceInfo.price.

Return (None, None) if self.variation_children do not exist. This is because we cannot return anything sensible.

Returns:a tuple of prices
Return type:(shuup.core.pricing.Price, shuup.core.pricing.Price)
Product.get_mode_display(*moreargs, **morekwargs)
Product.get_next_by_created_on(*moreargs, **morekwargs)
Product.get_next_by_modified_on(*moreargs, **morekwargs)
Product.get_package_child_to_quantity_map()[source]
Product.get_previous_by_created_on(*moreargs, **morekwargs)
Product.get_previous_by_modified_on(*moreargs, **morekwargs)
Product.get_price(context, quantity=1)[source]

Get price of the product within given context.

Note

When the current pricing module implements pricing steps, it is possible that p.get_price(ctx) * 123 is not equal to p.get_price(ctx, quantity=123), since there could be quantity discounts in effect, but usually they are equal.

Return type:shuup.core.pricing.Price
Product.get_price_info(context, quantity=1)[source]

Get PriceInfo object for the product in given context.

Returned PriceInfo object contains calculated price and base_price. The calculation of prices is handled in the current pricing module.

Return type:shuup.core.pricing.PriceInfo
Product.get_priced_children(context, quantity=1)[source]

Get child products with price infos sorted by price.

Return type:list[(Product,PriceInfo)]
Returns:List of products and their price infos sorted from cheapest to most expensive.
Product.get_public_media()[source]
Product.get_shipping_mode_display(*moreargs, **morekwargs)
Product.get_shop_instance(shop, allow_cache=False)[source]
Return type:shuup.core.models.ShopProduct
Product.get_stock_behavior_display(*moreargs, **morekwargs)
Product.get_variation_siblings()[source]
Product.is_container()[source]
Product.is_package_child()[source]
Product.is_package_parent()[source]
Product.is_stocked()[source]
Product.is_subscription_parent()[source]
Product.is_variation_child()[source]
Product.is_variation_parent()[source]
Product.keywords

Descriptor for translated attributes.

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

Product.link_to_parent(parent, variables=None, combination_hash=None)[source]
Parameters:
  • parent (Product) – The parent to link to.
  • variables (dict|None) – Optional dict of {variable identifier: value identifier} for complex variable linkage
  • combination_hash (str|None) – Optional combination hash (for variable variations), if precomputed. Mutually exclusive with variables
Product.log_entries
Product.make_package(package_def)[source]
Product.manufacturer
Product.media
Product.mode

A placeholder class that provides a way to set the attribute on the model.

Product.name

Descriptor for translated attributes.

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

Product.objects = <django.db.models.manager.ManagerFromProductQuerySet object>
Product.order_lines
Product.primary_image
Product.sales_unit
Product.save(*args, **kwargs)[source]
Product.shipments
Product.shipping_mode

A placeholder class that provides a way to set the attribute on the model.

Product.shop_products
Product.short_description

Descriptor for translated attributes.

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

Product.simplify_variation()[source]

Remove variation variables from the given variation parent, turning it into a simple variation (or a normal product, if it has no children).

Parameters:product (shuup.core.models.Product) – Variation parent to not be variable any longer.
Product.slug

Descriptor for translated attributes.

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

Product.soft_delete(user=None)[source]
Product.status_text

Descriptor for translated attributes.

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

Product.stock_behavior

A placeholder class that provides a way to set the attribute on the model.

Product.storedbasket_set
Product.suppliedproduct_set
Product.tax_class
Product.translations
Product.type
Product.unlink_from_parent()[source]
Product.variation_children
Product.variation_name

Descriptor for translated attributes.

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

Product.variation_parent
Product.variation_result_subs
Product.variation_result_supers
Product.variation_variables
Product.verify_mode()[source]
class shuup.core.models.ProductAttribute(id, attribute, numeric_value, datetime_value, untranslated_string_value, product)

Bases: shuup.core.models._attributes.AppliedAttribute

Parameters:
  • id (AutoField) – Id
  • attribute (ForeignKey to shuup.core.models.Attribute) – Attribute
  • numeric_value (DecimalField) – Numeric value
  • datetime_value (DateTimeField) – Datetime value
  • untranslated_string_value (TextField) – Untranslated value
  • product (ForeignKey to shuup.core.models.Product) – Product
  • translated_string_value (TextField) – (Translatable) Translated value
translations

ManyToOneRel to shuup.core.models._products.ProductAttributeTranslation

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception ProductAttribute.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

ProductAttribute.attribute
ProductAttribute.objects = <parler.managers.TranslatableManager object>
ProductAttribute.product
ProductAttribute.translated_string_value

Descriptor for translated attributes.

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

ProductAttribute.translations
class shuup.core.models.ProductCrossSell(id, product1, product2, weight, type)

Bases: django.db.models.base.Model

Parameters:
exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception ProductCrossSell.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

ProductCrossSell.get_type_display(*moreargs, **morekwargs)
ProductCrossSell.objects = <django.db.models.manager.Manager object>
ProductCrossSell.product1
ProductCrossSell.product2
ProductCrossSell.type

A placeholder class that provides a way to set the attribute on the model.

class shuup.core.models.ProductCrossSellType

Bases: enumfields.enums.Enum

An enumeration.

BOUGHT_WITH = <ProductCrossSellType.BOUGHT_WITH: 4>
COMPUTED = <ProductCrossSellType.COMPUTED: 3>
RECOMMENDED = <ProductCrossSellType.RECOMMENDED: 1>
RELATED = <ProductCrossSellType.RELATED: 2>
class shuup.core.models.ProductMedia(id, identifier, product, kind, file, external_url, ordering, enabled, public, purchased)

Bases: parler.models.TranslatableModel

Parameters:
  • id (AutoField) – Id
  • identifier (InternalIdentifierField) – Do not change this value if you are not sure what you are doing.
  • product (ForeignKey to shuup.core.models.Product) – Product
  • kind (EnumIntegerField) – Select what type the media is. It can either be a normal file, part of the documentation, or a sample.
  • file (FilerFileField to filer.models.filemodels.File) – File
  • external_url (URLField) – Enter URL to external file. If this field is filled, the selected media doesn’t apply.
  • ordering (IntegerField) – You enter the numerical order that your image will be displayed on your product page.
  • enabled (BooleanField) – Enabled
  • public (BooleanField) – Check this if you would like the image shown on your product page. Checked by default.
  • purchased (BooleanField) – Select this if you would like the product media shown for completed purchases.
  • shops (ManyToManyField to shuup.core.models.Shop) – Select which shops you would like the product media to be visible in.
  • title (CharField) – (Translatable) Choose a title for your product media. This will help it be found in your store and on the web.
  • description (TextField) – (Translatable) Write a description for your product media. This will help it be found in your store and on the web.
translations

ManyToOneRel to shuup.core.models._product_media.ProductMediaTranslation

log_entries

ManyToOneRel to shuup.core.models._product_media.ProductMediaLogEntry

primary_image_for_products

ManyToOneRel to shuup.core.models.Product

primary_image_for_shop_products

ManyToOneRel to shuup.core.models.ShopProduct

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception ProductMedia.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

ProductMedia.add_log_entry(message, identifier=None, kind=<LogEntryKind.OTHER: 0>, user=None, extra=None, save=True)
ProductMedia.description

Descriptor for translated attributes.

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

ProductMedia.easy_thumbnails_thumbnailer

Get Thumbnailer instance.

Will return None if file cannot be thumbnailed.

:rtype:easy_thumbnails.files.Thumbnailer|None

ProductMedia.effective_title
ProductMedia.file
ProductMedia.get_kind_display(*moreargs, **morekwargs)
ProductMedia.get_thumbnail(**kwargs)[source]

Get thumbnail for image

This will return None if there is no file or kind is not ProductMediaKind.IMAGE

Return type:easy_thumbnails.files.ThumbnailFile|None
ProductMedia.kind

A placeholder class that provides a way to set the attribute on the model.

ProductMedia.log_entries
ProductMedia.objects = <parler.managers.TranslatableManager object>
ProductMedia.primary_image_for_products
ProductMedia.primary_image_for_shop_products
ProductMedia.product
ProductMedia.shops
ProductMedia.title

Descriptor for translated attributes.

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

ProductMedia.translations
ProductMedia.url
class shuup.core.models.ProductMediaKind

Bases: enumfields.enums.Enum

An enumeration.

DOCUMENTATION = <ProductMediaKind.DOCUMENTATION: 3>
GENERIC_FILE = <ProductMediaKind.GENERIC_FILE: 1>
IMAGE = <ProductMediaKind.IMAGE: 2>
SAMPLE = <ProductMediaKind.SAMPLE: 4>
class shuup.core.models.ProductMode

Bases: enumfields.enums.Enum

An enumeration.

NORMAL = <ProductMode.NORMAL: 0>
PACKAGE_PARENT = <ProductMode.PACKAGE_PARENT: 1>
SIMPLE_VARIATION_PARENT = <ProductMode.SIMPLE_VARIATION_PARENT: 2>
SUBSCRIPTION = <ProductMode.SUBSCRIPTION: 5>
VARIABLE_VARIATION_PARENT = <ProductMode.VARIABLE_VARIATION_PARENT: 3>
VARIATION_CHILD = <ProductMode.VARIATION_CHILD: 4>

Bases: django.db.models.base.Model

Parameters:
exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception ProductPackageLink.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

ProductPackageLink.child
ProductPackageLink.objects = <django.db.models.manager.Manager object>
ProductPackageLink.parent
class shuup.core.models.ProductType(id, identifier)

Bases: parler.models.TranslatableModel

Parameters:
  • id (AutoField) – Id
  • identifier (InternalIdentifierField) – Do not change this value if you are not sure what you are doing.
  • attributes (ManyToManyField to shuup.core.models.Attribute) – Select attributes that go with your product type. These are defined in Products Settings – Attributes.
  • name (CharField) – (Translatable) Enter a descriptive name for your product type. Products and attributes for products of this type can be found under this name.
translations

ManyToOneRel to shuup.core.models._products.ProductTypeTranslation

products

ManyToOneRel to shuup.core.models.Product

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception ProductType.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

ProductType.attributes
ProductType.name

Descriptor for translated attributes.

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

ProductType.objects = <parler.managers.TranslatableManager object>
ProductType.products
ProductType.translations
class shuup.core.models.ProductVariationLinkStatus

Bases: enumfields.enums.Enum

An enumeration.

INVISIBLE = <ProductVariationLinkStatus.INVISIBLE: 0>
VISIBLE = <ProductVariationLinkStatus.VISIBLE: 1>
class shuup.core.models.ProductVariationResult(id, product, combination_hash, result, status)

Bases: django.db.models.base.Model

Parameters:
exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception ProductVariationResult.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

ProductVariationResult.get_status_display(*moreargs, **morekwargs)
ProductVariationResult.objects = <django.db.models.manager.Manager object>
ProductVariationResult.product
classmethod ProductVariationResult.resolve(parent_product, combination)[source]
ProductVariationResult.result
ProductVariationResult.status

A placeholder class that provides a way to set the attribute on the model.

class shuup.core.models.ProductVariationVariable(id, ordering, product, identifier)

Bases: parler.models.TranslatableModel, shuup.utils.models.SortableMixin

Parameters:
  • id (AutoField) – Id
  • ordering (SmallIntegerField) – Ordering
  • product (ForeignKey to shuup.core.models.Product) – Product
  • identifier (InternalIdentifierField) – Do not change this value if you are not sure what you are doing.
  • name (CharField) – (Translatable) Name
translations

ManyToOneRel to shuup.core.models._product_variation.ProductVariationVariableTranslation

values

ManyToOneRel to shuup.core.models.ProductVariationVariableValue

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception ProductVariationVariable.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

ProductVariationVariable.name

Descriptor for translated attributes.

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

ProductVariationVariable.objects = <parler.managers.TranslatableManager object>
ProductVariationVariable.product
ProductVariationVariable.translations
ProductVariationVariable.values
class shuup.core.models.ProductVariationVariableValue(id, ordering, variable, identifier)

Bases: parler.models.TranslatableModel, shuup.utils.models.SortableMixin

Parameters:
translations

ManyToOneRel to shuup.core.models._product_variation.ProductVariationVariableValueTranslation

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception ProductVariationVariableValue.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

ProductVariationVariableValue.objects = <parler.managers.TranslatableManager object>
ProductVariationVariableValue.translations
ProductVariationVariableValue.value

Descriptor for translated attributes.

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

ProductVariationVariableValue.variable
class shuup.core.models.ProductVisibility

Bases: enumfields.enums.Enum

An enumeration.

VISIBLE_TO_ALL = <ProductVisibility.VISIBLE_TO_ALL: 1>
VISIBLE_TO_GROUPS = <ProductVisibility.VISIBLE_TO_GROUPS: 3>
VISIBLE_TO_LOGGED_IN = <ProductVisibility.VISIBLE_TO_LOGGED_IN: 2>
class shuup.core.models.RoundingMode

Bases: enumfields.enums.Enum

An enumeration.

ROUND_DOWN = <RoundingMode.ROUND_DOWN: 'ROUND_DOWN'>
ROUND_HALF_DOWN = <RoundingMode.ROUND_HALF_DOWN: 'ROUND_HALF_DOWN'>
ROUND_HALF_UP = <RoundingMode.ROUND_HALF_UP: 'ROUND_HALF_UP'>
ROUND_UP = <RoundingMode.ROUND_UP: 'ROUND_UP'>
class shuup.core.models.SalesUnit(id, identifier, decimals)

Bases: shuup.core.models._units._ShortNameToSymbol, shuup.core.models.TranslatableShuupModel

Parameters:
  • id (AutoField) – Id
  • identifier (InternalIdentifierField) – Do not change this value if you are not sure what you are doing.
  • decimals (PositiveSmallIntegerField) – The number of decimal places allowed by this sales unit.Set this to a value greater than zero if products with this sales unit can be sold in fractional quantities
  • name (CharField) – (Translatable) The sales unit name to use for products (For example, ‘pieces’ or ‘units’). Sales units can be set for each product through the product editor view.
  • symbol (CharField) – (Translatable) An abbreviated name for this sales unit that is shown throughout admin and order invoices.
translations

ManyToOneRel to shuup.core.models._units.SalesUnitTranslation

display_units

ManyToOneRel to shuup.core.models.DisplayUnit

product_set

ManyToOneRel to shuup.core.models.Product

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception SalesUnit.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

SalesUnit.allow_fractions
SalesUnit.display_unit

Default display unit of this sales unit.

Get a DisplayUnit object, which has this sales unit as its internal unit and is marked as a default, or if there is no default display unit for this sales unit, then a proxy object. The proxy object has the same display unit interface and mirrors the properties of the sales unit, such as symbol and decimals.

Return type:DisplayUnit
SalesUnit.display_units
SalesUnit.name

Descriptor for translated attributes.

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

SalesUnit.objects = <parler.managers.TranslatableManager object>
SalesUnit.product_set
SalesUnit.quantity_step

Get the quantity increment for the amount of decimals this unit allows.

For 0 decimals, this will be 1; for 1 decimal, 0.1; etc.

Returns:Decimal in (0..1]
Return type:Decimal
SalesUnit.round(value)[source]
SalesUnit.symbol

Descriptor for translated attributes.

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

SalesUnit.translations
class shuup.core.models.SavedAddress(*args, **kwargs)

Bases: shuup.core.models.ShuupModel

Model for saving multiple addresses in an ‘address book’ of sorts.

Parameters:
log_entries

ManyToOneRel to shuup.core.models._addresses.SavedAddressLogEntry

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception SavedAddress.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

SavedAddress.add_log_entry(message, identifier=None, kind=<LogEntryKind.OTHER: 0>, user=None, extra=None, save=True)
SavedAddress.address
SavedAddress.get_role_display(*moreargs, **morekwargs)
SavedAddress.get_status_display(*moreargs, **morekwargs)
SavedAddress.get_title()[source]

Returns the display title for this SavedAddress instance. Defaults to a short representation of the address.

This method should be used instead of accessing the title field directly when displaying SavedAddress objects.

SavedAddress.log_entries
SavedAddress.objects = <shuup.core.models._addresses.SavedAddressManager object>
SavedAddress.owner
SavedAddress.role

A placeholder class that provides a way to set the attribute on the model.

SavedAddress.status

A placeholder class that provides a way to set the attribute on the model.

class shuup.core.models.SavedAddressRole

Bases: enumfields.enums.Enum

An enumeration.

BILLING = <SavedAddressRole.BILLING: 2>
SHIPPING = <SavedAddressRole.SHIPPING: 1>
class shuup.core.models.SavedAddressStatus

Bases: enumfields.enums.Enum

An enumeration.

DISABLED = <SavedAddressStatus.DISABLED: 0>
ENABLED = <SavedAddressStatus.ENABLED: 1>
class shuup.core.models.Service(*args, **kwargs)

Bases: shuup.core.models.TranslatableShuupModel

Abstract base model for services.

Each enabled service should be linked to a service provider and should have a choice identifier specified in its choice_identifier field. The choice identifier should be valid for the service provider, i.e. it should be one of the ServiceChoice.identifier values returned by the ServiceProvider.get_service_choices method.

Parameters:
  • identifier (InternalIdentifierField) – Do not change this value if you are not sure what you are doing.
  • enabled (BooleanField) – Check this if this service is selectable on checkout.
  • shop (ForeignKey to shuup.core.models.Shop) – The shop for this service.
  • choice_identifier (CharField) – Choice identifier
  • old_module_identifier (CharField) – Old module identifier
  • old_module_data (JSONField) – Old module data
  • logo (FilerImageField to filer.models.imagemodels.Image) – Logo
  • tax_class (ForeignKey to shuup.core.models.TaxClass) – The tax class to use for this service. Tax classes are defined in Settings - Tax Classes.
  • behavior_components (ManyToManyField to shuup.core.models.ServiceBehaviorComponent) – Behavior components
class Meta[source]

Bases: object

abstract = False
Service.behavior_components
Service.description

Descriptor for translated attributes.

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

Service.get_costs(source)[source]

Get costs of this service for items in given source.

Returns:description, price and tax class of the costs
Return type:Iterable[ServiceCost]
Service.get_effective_name(source)[source]

Get effective name of the service for given order source.

By default, effective name is the same as name of this service, but if there is a service provider with a custom implementation for get_effective_name method, then this can be different.

Return type:str
Service.get_lines(source)[source]

Get lines for given source.

Lines are created based on costs. Costs without description are combined to single line.

Return type:Iterable[shuup.core.order_creator.SourceLine]
Service.get_total_cost(source)[source]

Get total cost of this service for items in given source.

Return type:PriceInfo
Service.get_unavailability_reasons(source)[source]

Get reasons of being unavailable for given source.

Return type:Iterable[ValidationError]
Service.is_available_for(source)[source]

Return true if service is available for given source.

Return type:bool
Service.name

Descriptor for translated attributes.

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

Service.objects
Service.old_module_data

A placeholder class that provides a way to set the attribute on the model.

Service.provider
Return type:shuup.core.models.ServiceProvider
Service.shop
Service.tax_class
class shuup.core.models.ServiceBehaviorComponent(id, polymorphic_ctype)

Bases: shuup.core.models.PolymorphicShuupModel

Parameters:
fixedcostbehaviorcomponent_set

OneToOneRel to shuup.core.models.FixedCostBehaviorComponent

waivingcostbehaviorcomponent_set

OneToOneRel to shuup.core.models.WaivingCostBehaviorComponent

weightlimitsbehaviorcomponent_set

OneToOneRel to shuup.core.models.WeightLimitsBehaviorComponent

weightbasedpricingbehaviorcomponent_set

OneToOneRel to shuup.core.models.WeightBasedPricingBehaviorComponent

groupavailabilitybehaviorcomponent_set

OneToOneRel to shuup.core.models.GroupAvailabilityBehaviorComponent

staffonlybehaviorcomponent_set

OneToOneRel to shuup.core.models.StaffOnlyBehaviorComponent

ordertotallimitbehaviorcomponent_set

OneToOneRel to shuup.core.models.OrderTotalLimitBehaviorComponent

countrylimitbehaviorcomponent_set

OneToOneRel to shuup.core.models.CountryLimitBehaviorComponent

expensiveswedenbehaviorcomponent_set

OneToOneRel to shuup.testing.models._behavior_components.ExpensiveSwedenBehaviorComponent

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception ServiceBehaviorComponent.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

ServiceBehaviorComponent.base_objects = <django.db.models.manager.Manager object>
ServiceBehaviorComponent.countrylimitbehaviorcomponent
ServiceBehaviorComponent.expensiveswedenbehaviorcomponent
ServiceBehaviorComponent.fixedcostbehaviorcomponent
ServiceBehaviorComponent.get_costs(service, source)[source]

Return costs for for this object. This should be implemented in subclass. This method is used to calculate price for ShippingMethod and PaymentMethod objects.

Return type:Iterable[ServiceCost]
ServiceBehaviorComponent.get_delivery_time(service, source)[source]
Return type:shuup.utils.dates.DurationRange|None
ServiceBehaviorComponent.get_unavailability_reasons(service, source)[source]
Return type:Iterable[ValidationError]
ServiceBehaviorComponent.groupavailabilitybehaviorcomponent
ServiceBehaviorComponent.help_text = None
ServiceBehaviorComponent.name = None
ServiceBehaviorComponent.objects = <polymorphic.managers.PolymorphicManager object>
ServiceBehaviorComponent.ordertotallimitbehaviorcomponent
ServiceBehaviorComponent.paymentmethod_set
ServiceBehaviorComponent.polymorphic_ctype
ServiceBehaviorComponent.polymorphic_primary_key_name = 'id'
ServiceBehaviorComponent.polymorphic_super_sub_accessors_replaced = False
ServiceBehaviorComponent.shippingmethod_set
ServiceBehaviorComponent.staffonlybehaviorcomponent
ServiceBehaviorComponent.waivingcostbehaviorcomponent
ServiceBehaviorComponent.weightbasedpricingbehaviorcomponent
ServiceBehaviorComponent.weightlimitsbehaviorcomponent
class shuup.core.models.ServiceChoice(identifier, name)

Bases: object

Choice of service provided by a service provider.

Initialize service choice.

Parameters:
  • identifier (str) – Internal identifier for the service. Should be unique within a single ServiceProvider.
  • name (str) – Descriptive name of the service in currently active language.
class shuup.core.models.ServiceCost(price, description=None, tax_class=None, base_price=None)

Bases: object

A cost of a service.

One service might have several costs.

Initialize cost from values.

Note: If tax_class is specified, also description must be given.

price_info
class shuup.core.models.ServiceProvider(*args, **kwargs)

Bases: shuup.core.models.PolymorphicTranslatableShuupModel

Entity that provides services.

Good examples of service providers are Carrier and PaymentProcessor.

When subclassing ServiceProvider, set value for service_model class attribute. It should be a model class which is subclass of Service.

Parameters:
  • id (AutoField) – Id
  • polymorphic_ctype (ForeignKey to django.contrib.contenttypes.models.ContentType) – Polymorphic ctype
  • identifier (InternalIdentifierField) – Do not change this value if you are not sure what you are doing.
  • enabled (BooleanField) – Check this if this service provider can be used when placing orders
  • logo (FilerImageField to filer.models.imagemodels.Image) – Logo
  • name (CharField) – (Translatable) The service provider name.
base_translations

ManyToOneRel to shuup.core.models._service_base.ServiceProviderTranslation

paymentprocessor_set

OneToOneRel to shuup.core.models.PaymentProcessor

carrier_set

OneToOneRel to shuup.core.models.Carrier

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
  • identifier (InternalIdentifierField) – Do not change this value if you are not sure what you are doing.
  • enabled (BooleanField) – Check this if this service provider can be used when placing orders
  • logo (FilerImageField to filer.models.imagemodels.Image) – Logo
  • name (CharField) – (Translatable) The service provider name.
base_translations

ManyToOneRel to shuup.core.models._service_base.ServiceProviderTranslation

paymentprocessor_set

OneToOneRel to shuup.core.models.PaymentProcessor

carrier_set

OneToOneRel to shuup.core.models.Carrier

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception ServiceProvider.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

ServiceProvider.base_objects = <parler.managers.TranslatableManager object>
ServiceProvider.base_translations
ServiceProvider.carrier
ServiceProvider.create_service(choice_identifier, **kwargs)[source]

Create a service for given choice identifier.

Subclass implementation may attach some behavior components to the created service.

Subclasses should provide implementation for _create_service or override this. Base class implementation calls the _create_service method with resolved choice_identifier.

Parameters:choice_identifier (str|None) – Identifier of the service choice to use. If None, use the default service choice.
Return type:shuup.core.models.Service
ServiceProvider.get_effective_name(service, source)[source]

Get effective name of the service for given order source.

Base class implementation will just return name of the given service, but that may be changed in a subclass.

Return type:str
ServiceProvider.get_service_choices()[source]

Get all service choices of this provider.

Subclasses should implement this method.

Return type:list[ServiceChoice]
ServiceProvider.name

Descriptor for translated attributes.

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

ServiceProvider.objects = <shuup.core.models._base._PolyTransManager object>
ServiceProvider.paymentprocessor
ServiceProvider.polymorphic_ctype
ServiceProvider.polymorphic_primary_key_name = 'id'
ServiceProvider.polymorphic_super_sub_accessors_replaced = False
ServiceProvider.service_model = None
class shuup.core.models.Shipment(id, order, supplier, created_on, status, tracking_code, description, volume, weight, identifier, type)

Bases: shuup.core.models.ShuupModel

Parameters:
  • id (AutoField) – Id
  • order (ForeignKey to shuup.core.models.Order) – Order
  • supplier (ForeignKey to shuup.core.models.Supplier) – Supplier
  • created_on (DateTimeField) – Created on
  • status (EnumIntegerField) – Status
  • tracking_code (CharField) – Tracking code
  • description (CharField) – Description
  • volume (MeasurementField) – Volume
  • weight (MeasurementField) – Weight
  • identifier (InternalIdentifierField) – Do not change this value if you are not sure what you are doing.
  • type (EnumIntegerField) – Type
products

ManyToOneRel to shuup.core.models.ShipmentProduct

log_entries

ManyToOneRel to shuup.core.models._shipments.ShipmentLogEntry

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception Shipment.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

Shipment.add_log_entry(message, identifier=None, kind=<LogEntryKind.OTHER: 0>, user=None, extra=None, save=True)
Shipment.cache_values()[source]

(Re)cache volume and weight for this Shipment from the ShipmentProducts within.

Shipment.delete(using=None)[source]
Shipment.get_next_by_created_on(*moreargs, **morekwargs)
Shipment.get_previous_by_created_on(*moreargs, **morekwargs)
Shipment.get_status_display(*moreargs, **morekwargs)
Shipment.get_type_display(*moreargs, **morekwargs)
Shipment.is_deleted()[source]
Shipment.log_entries
Shipment.objects = <shuup.core.models._shipments.ShipmentManager object>
Shipment.order
Shipment.products
Shipment.save(*args, **kwargs)[source]
Shipment.set_received(purchase_prices=None, created_by=None)[source]

Mark shipment received

In case shipment is incoming add stock adjustment for each shipment product in this shipment.

Parameters:
  • purchase_prices (dict[shuup.shop.models.Product, decimal.Decimal]) – a dict mapping product ids to purchase prices
  • created_by (settings.AUTH_USER_MODEL) – user who set this shipment received
Shipment.soft_delete(user=None)[source]
Shipment.status

A placeholder class that provides a way to set the attribute on the model.

Shipment.supplier
Shipment.total_products
Shipment.type

A placeholder class that provides a way to set the attribute on the model.

class shuup.core.models.ShipmentProduct(id, shipment, product, quantity, unit_volume, unit_weight)

Bases: shuup.core.models.ShuupModel

Parameters:
log_entries

ManyToOneRel to shuup.core.models._shipments.ShipmentProductLogEntry

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception ShipmentProduct.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

ShipmentProduct.add_log_entry(message, identifier=None, kind=<LogEntryKind.OTHER: 0>, user=None, extra=None, save=True)
ShipmentProduct.cache_values()[source]
ShipmentProduct.log_entries
ShipmentProduct.objects = <django.db.models.manager.Manager object>
ShipmentProduct.product
ShipmentProduct.shipment
class shuup.core.models.ShipmentStatus

Bases: enumfields.enums.Enum

An enumeration.

DELETED = <ShipmentStatus.DELETED: 20>
ERROR = <ShipmentStatus.ERROR: 10>
NOT_SENT = <ShipmentStatus.NOT_SENT: 0>
RECEIVED = <ShipmentStatus.RECEIVED: 2>
SENT = <ShipmentStatus.SENT: 1>
class shuup.core.models.ShipmentType

Bases: enumfields.enums.Enum

An enumeration.

IN = <ShipmentType.IN: 1>
OUT = <ShipmentType.OUT: 0>
class shuup.core.models.ShippingMethod(id, identifier, enabled, shop, choice_identifier, old_module_identifier, old_module_data, logo, tax_class, carrier)

Bases: shuup.core.models.Service

Parameters:
  • id (AutoField) – Id
  • identifier (InternalIdentifierField) – Do not change this value if you are not sure what you are doing.
  • enabled (BooleanField) – Check this if this service is selectable on checkout.
  • shop (ForeignKey to shuup.core.models.Shop) – The shop for this service.
  • choice_identifier (CharField) – Choice identifier
  • old_module_identifier (CharField) – Old module identifier
  • old_module_data (JSONField) – Old module data
  • logo (FilerImageField to filer.models.imagemodels.Image) – Logo
  • tax_class (ForeignKey to shuup.core.models.TaxClass) – The tax class to use for this service. Tax classes are defined in Settings - Tax Classes.
  • carrier (ForeignKey to shuup.core.models.Carrier) – Carrier
  • behavior_components (ManyToManyField to shuup.core.models.ServiceBehaviorComponent) – Behavior components
  • name (CharField) – (Translatable) The shipping method name. This name is shown to customers on checkout.
  • description (CharField) – (Translatable) Description
shipping_orders

ManyToOneRel to shuup.core.models.Order

contact_set

ManyToOneRel to shuup.core.models.Contact

translations

ManyToOneRel to shuup.core.models._service_shipping.ShippingMethodTranslation

log_entries

ManyToOneRel to shuup.core.models._service_shipping.ShippingMethodLogEntry

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception ShippingMethod.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

ShippingMethod.add_log_entry(message, identifier=None, kind=<LogEntryKind.OTHER: 0>, user=None, extra=None, save=True)
ShippingMethod.behavior_components
ShippingMethod.can_delete()[source]
ShippingMethod.carrier
ShippingMethod.contact_set
ShippingMethod.description

Descriptor for translated attributes.

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

ShippingMethod.get_shipping_time(source)[source]

Get shipping time for items in given source.

Return type:shuup.utils.dates.DurationRange|None
ShippingMethod.line_type = <OrderLineType.SHIPPING: 2>
ShippingMethod.log_entries
ShippingMethod.name

Descriptor for translated attributes.

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

ShippingMethod.objects = <django.db.models.manager.ManagerFromServiceQuerySet object>
ShippingMethod.old_module_data

A placeholder class that provides a way to set the attribute on the model.

ShippingMethod.provider_attr = 'carrier'
ShippingMethod.shipping_orders
ShippingMethod.shipping_products
ShippingMethod.shop
ShippingMethod.shop_product_m2m = 'shipping_methods'
ShippingMethod.tax_class
ShippingMethod.translations
class shuup.core.models.ShippingMode

Bases: enumfields.enums.Enum

An enumeration.

NOT_SHIPPED = <ShippingMode.NOT_SHIPPED: 0>
SHIPPED = <ShippingMode.SHIPPED: 1>
class shuup.core.models.ShippingStatus

Bases: enumfields.enums.Enum

An enumeration.

FULLY_SHIPPED = <ShippingStatus.FULLY_SHIPPED: 2>
NOT_SHIPPED = <ShippingStatus.NOT_SHIPPED: 0>
PARTIALLY_SHIPPED = <ShippingStatus.PARTIALLY_SHIPPED: 1>
class shuup.core.models.ShuupModel(*args, **kwargs)

Bases: django.db.models.base.Model

Shuup Model.

class Meta[source]

Bases: object

abstract = False
ShuupModel.identifier_attr = 'identifier'
class shuup.core.models.Shop(id, created_on, modified_on, identifier, domain, status, owner, options, currency, prices_include_tax, logo, favicon, maintenance_mode, contact_address)

Bases: shuup.core.models._base.ChangeProtected, shuup.core.models.TranslatableShuupModel

Parameters:
  • id (AutoField) – Id
  • created_on (DateTimeField) – Created on
  • modified_on (DateTimeField) – Modified on
  • identifier (InternalIdentifierField) – Do not change this value if you are not sure what you are doing.
  • domain (CharField) – Your shop domain name. Use this field to configure the URL that is used to visit your site. Note: this requires additional configuration through your internet domain registrar.
  • status (EnumIntegerField) – Your shop status. Disable your shop if it is no longer in use.
  • owner (ForeignKey to shuup.core.models.Contact) – Contact
  • options (JSONField) – Options
  • currency (CurrencyField) – The primary shop currency. This is the currency used when selling your products.
  • prices_include_tax (BooleanField) – This option defines whether product prices entered in admin include taxes. Note this behavior can be overridden with contact group pricing.
  • logo (FilerImageField to filer.models.imagemodels.Image) – Shop logo. Will be shown at theme.
  • favicon (FilerImageField to filer.models.imagemodels.Image) – Shop favicon. Will be shown next to the address on browser.
  • maintenance_mode (BooleanField) – Check this if you would like to make your shop temporarily unavailable while you do some shop maintenance.
  • contact_address (ForeignKey to shuup.core.models.MutableAddress) – Contact address
  • staff_members (ManyToManyField to django.contrib.auth.models.User) – Staff members
  • name (CharField) – (Translatable) The shop name. This name is displayed throughout admin.
  • public_name (CharField) – (Translatable) The public shop name. This name is displayed in the store front and in any customer email correspondence.
  • maintenance_message (CharField) – (Translatable) The message to display to customers while your shop is in maintenance mode.
basket_set

ManyToOneRel to shuup.core.models.Basket

order_set

ManyToOneRel to shuup.core.models.Order

translations

ManyToOneRel to shuup.core.models._shops.ShopTranslation

log_entries

ManyToOneRel to shuup.core.models._shops.ShopLogEntry

shop_products

ManyToOneRel to shuup.core.models.ShopProduct

paymentmethod_set

ManyToOneRel to shuup.core.models.PaymentMethod

shippingmethod_set

ManyToOneRel to shuup.core.models.ShippingMethod

storedbasket_set

ManyToOneRel to shuup.front.models.stored_basket.StoredBasket

catalogcampaign_set

ManyToOneRel to shuup.campaigns.models.campaigns.CatalogCampaign

basketcampaign_set

ManyToOneRel to shuup.campaigns.models.campaigns.BasketCampaign

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception Shop.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

Shop.add_log_entry(message, identifier=None, kind=<LogEntryKind.OTHER: 0>, user=None, extra=None, save=True)
Shop.basket_set
Shop.basketcampaign_set
Shop.catalogcampaign_set
Shop.categories
Shop.change_protect_message = <django.utils.functional.lazy.<locals>.__proxy__ object>
Shop.contact_address
Shop.create_price(value)[source]

Create a price with given value and settings of this shop.

Takes the prices_include_tax and currency settings of this Shop into account.

Return type:shuup.core.pricing.Price
Shop.favicon
Shop.get_next_by_created_on(*moreargs, **morekwargs)
Shop.get_next_by_modified_on(*moreargs, **morekwargs)
Shop.get_previous_by_created_on(*moreargs, **morekwargs)
Shop.get_previous_by_modified_on(*moreargs, **morekwargs)
Shop.get_status_display(*moreargs, **morekwargs)
Shop.log_entries
Shop.maintenance_message

Descriptor for translated attributes.

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

Shop.name

Descriptor for translated attributes.

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

Shop.objects = <parler.managers.TranslatableManager object>
Shop.options

A placeholder class that provides a way to set the attribute on the model.

Shop.order_set
Shop.owner
Shop.paymentmethod_set
Shop.product_media
Shop.protected_fields = ['currency', 'prices_include_tax']
Shop.public_name

Descriptor for translated attributes.

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

Shop.shippingmethod_set
Shop.shop_products
Shop.staff_members
Shop.status

A placeholder class that provides a way to set the attribute on the model.

Shop.storedbasket_set
Shop.translations
class shuup.core.models.ShopProduct(id, shop, product, visibility, purchasable, visibility_limit, backorder_maximum, purchase_multiple, minimum_purchase_quantity, limit_shipping_methods, limit_payment_methods, primary_category, shop_primary_image, default_price_value, minimum_price_value, display_unit)

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

Parameters:
  • id (AutoField) – Id
  • shop (ForeignKey to shuup.core.models.Shop) – Shop
  • product (UnsavedForeignKey to shuup.core.models.Product) – Product
  • visibility (EnumIntegerField) – Select if you want your product to be seen and found by customers. Not visible: Product will not be shown in your store front or found in search.Searchable: Product will be shown in search but not listed on any category page.Listed: Product will be shown on category pages but not shown in search results.Always Visible: Product will be shown in your store front and found in search.
  • purchasable (BooleanField) – Purchasable
  • visibility_limit (EnumIntegerField) – Select whether you want your product to have special limitations on its visibility in your store. You can make products visible to all, visible to only logged in users, or visible only to certain customer groups.
  • backorder_maximum (QuantityField) – The number of units that can be purchased after the product is out of stock. Set to blank for product to be purchasable without limits.
  • purchase_multiple (QuantityField) – Set this if the product needs to be purchased in multiples. For example, if the purchase multiple is set to 2, then customers are required to order the product in multiples of 2.
  • minimum_purchase_quantity (QuantityField) – Set a minimum number of products needed to be ordered for the purchase. This is useful for setting bulk orders and B2B purchases.
  • limit_shipping_methods (BooleanField) – Check this if you want to limit your product to use only select payment methods. You can select the payment method(s) in the field below.
  • limit_payment_methods (BooleanField) – Check this if you want to limit your product to use only select payment methods. You can select the payment method(s) in the field below.
  • primary_category (ForeignKey to shuup.core.models.Category) – Choose the primary category for your product. This will be the main category for classification in the system. Your product can be found under this category in your store. Categories are defined in Products Settings - Categories.
  • shop_primary_image (ForeignKey to shuup.core.models.ProductMedia) – Click this to set this image as the primary display image for your product.
  • default_price_value (MoneyValueField) – This is the default individual base unit (or multi-pack) price of the product. All discounts or coupons will be based off of this price.
  • minimum_price_value (MoneyValueField) – This is the default price that the product cannot go under in your store, despite coupons or discounts being applied. This is useful to make sure your product price stays above cost.
  • display_unit (ForeignKey to shuup.core.models.DisplayUnit) – Unit for displaying quantities of this product
  • suppliers (ManyToManyField to shuup.core.models.Supplier) – List your suppliers here. Suppliers can be found in Product Settings - Suppliers.
  • visibility_groups (ManyToManyField to shuup.core.models.ContactGroup) – Select the groups you would like to make your product visible for. These groups are defined in Contacts Settings - Contact Groups.
  • shipping_methods (ManyToManyField to shuup.core.models.ShippingMethod) – Select the shipping methods you would like to limit the product to using. These are defined in Settings - Shipping Methods.
  • payment_methods (ManyToManyField to shuup.core.models.PaymentMethod) – Select the payment methods you would like to limit the product to using. These are defined in Settings - Payment Methods.
  • categories (ManyToManyField to shuup.core.models.Category) – Add secondary categories for your product. These are other categories that your product fits under and that it can be found by in your store.
  • name (CharField) – (Translatable) Enter a descriptive name for your product. This will be its title in your store.
  • description (TextField) – (Translatable) To make your product stand out, give it an awesome description. This is what will help your shoppers learn about your products. It will also help shoppers find them in the store and on the web.
  • short_description (CharField) – (Translatable) Enter a short description for your product. The short description will be used to get the attention of your customer with a small but precise description of your product.
translations

ManyToOneRel to shuup.core.models._product_shops.ShopProductTranslation

log_entries

ManyToOneRel to shuup.core.models._product_shops.ShopProductLogEntry

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception ShopProduct.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

ShopProduct.add_log_entry(message, identifier=None, kind=<LogEntryKind.OTHER: 0>, user=None, extra=None, save=True)
ShopProduct.categories
ShopProduct.clean()[source]
ShopProduct.default_price

Property for Price object.

Similar to MoneyProperty but also has includes_tax field.

Operaters with TaxfulPrice and TaxlessPrice objects.

ShopProduct.description

Descriptor for translated attributes.

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

ShopProduct.display_quantity_minimum

Quantity minimum of this shop product in the display unit.

Note: This can never be smaller than the display precision.

ShopProduct.display_quantity_step

Quantity step of this shop product in the display unit.

Note: This can never be smaller than the display precision.

ShopProduct.display_unit
ShopProduct.get_orderability_errors(supplier, quantity, customer, ignore_minimum=False)[source]

Yield ValidationErrors that would cause this product to not be orderable.

Parameters:
  • supplier (shuup.core.models.Supplier) – Supplier to order this product from. May be None.
  • quantity (int|Decimal) – Quantity to order.
  • customer (shuup.core.models.Contact) – Customer contact.
  • ignore_minimum (bool) – Ignore any limitations caused by quantity minimums.
Returns:

Iterable[ValidationError]

ShopProduct.get_quantity_errors(quantity)[source]
ShopProduct.get_visibility_display(*moreargs, **morekwargs)
ShopProduct.get_visibility_errors(customer)[source]
ShopProduct.get_visibility_limit_display(*moreargs, **morekwargs)
ShopProduct.images
ShopProduct.is_list_visible()[source]

Return True if this product should be visible in listings in general, without taking into account any other visibility limitations. :rtype: bool

ShopProduct.is_orderable(supplier, customer, quantity, allow_cache=True)[source]
ShopProduct.is_visible(customer)[source]
ShopProduct.listed
ShopProduct.log_entries
ShopProduct.minimum_price

Property for Price object.

Similar to MoneyProperty but also has includes_tax field.

Operaters with TaxfulPrice and TaxlessPrice objects.

ShopProduct.name

Descriptor for translated attributes.

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

ShopProduct.objects = <parler.managers.TranslatableManager object>
ShopProduct.payment_methods
ShopProduct.primary_category
ShopProduct.primary_image
ShopProduct.product
ShopProduct.public_images
ShopProduct.public_primary_image
ShopProduct.quantity_step

Quantity step for purchasing this product.

Return type:decimal.Decimal
Example:
<input type=”number” step=”{{ shop_product.quantity_step }}”>
ShopProduct.raise_if_not_orderable(supplier, customer, quantity, ignore_minimum=False)[source]
ShopProduct.raise_if_not_visible(customer)[source]
ShopProduct.rounded_minimum_purchase_quantity

The minimum purchase quantity, rounded to the sales unit’s precision.

Return type:decimal.Decimal
Example:
<input type=”number”
min=”{{ shop_product.rounded_minimum_purchase_quantity }}” value=”{{ shop_product.rounded_minimum_purchase_quantity }}”>
ShopProduct.save(*args, **kwargs)[source]
ShopProduct.searchable
ShopProduct.shipping_methods
ShopProduct.shop
ShopProduct.shop_primary_image
ShopProduct.short_description

Descriptor for translated attributes.

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

ShopProduct.suppliers
ShopProduct.translations
ShopProduct.unit

Unit of this product.

Return type:shuup.core.models.UnitInterface
ShopProduct.visibility

A placeholder class that provides a way to set the attribute on the model.

ShopProduct.visibility_groups
ShopProduct.visibility_limit

A placeholder class that provides a way to set the attribute on the model.

ShopProduct.visible
class shuup.core.models.ShopProductVisibility

Bases: enumfields.enums.Enum

An enumeration.

ALWAYS_VISIBLE = <ShopProductVisibility.ALWAYS_VISIBLE: 3>
LISTED = <ShopProductVisibility.LISTED: 2>
NOT_VISIBLE = <ShopProductVisibility.NOT_VISIBLE: 0>
SEARCHABLE = <ShopProductVisibility.SEARCHABLE: 1>
class shuup.core.models.ShopStatus

Bases: enumfields.enums.Enum

An enumeration.

DISABLED = <ShopStatus.DISABLED: 0>
ENABLED = <ShopStatus.ENABLED: 1>
class shuup.core.models.StaffOnlyBehaviorComponent(id, polymorphic_ctype, servicebehaviorcomponent_ptr)

Bases: shuup.core.models.ServiceBehaviorComponent

Parameters:
exception DoesNotExist

Bases: shuup.core.models._service_base.DoesNotExist

exception StaffOnlyBehaviorComponent.MultipleObjectsReturned

Bases: shuup.core.models._service_base.MultipleObjectsReturned

StaffOnlyBehaviorComponent.base_objects = <django.db.models.manager.Manager object>
StaffOnlyBehaviorComponent.get_unavailability_reasons(service, source)[source]
StaffOnlyBehaviorComponent.help_text = <django.utils.functional.lazy.<locals>.__proxy__ object>
StaffOnlyBehaviorComponent.name = <django.utils.functional.lazy.<locals>.__proxy__ object>
StaffOnlyBehaviorComponent.objects = <polymorphic.managers.PolymorphicManager object>
StaffOnlyBehaviorComponent.polymorphic_primary_key_name = 'id'
StaffOnlyBehaviorComponent.polymorphic_super_sub_accessors_replaced = False
StaffOnlyBehaviorComponent.servicebehaviorcomponent_ptr
class shuup.core.models.StockBehavior

Bases: enumfields.enums.Enum

An enumeration.

STOCKED = <StockBehavior.STOCKED: 1>
UNSTOCKED = <StockBehavior.UNSTOCKED: 0>
class shuup.core.models.SuppliedProduct(id, supplier, product, sku, alert_limit, physical_count, logical_count)

Bases: django.db.models.base.Model

Parameters:
log_entries

ManyToOneRel to shuup.core.models._supplied_products.SuppliedProductLogEntry

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception SuppliedProduct.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

SuppliedProduct.add_log_entry(message, identifier=None, kind=<LogEntryKind.OTHER: 0>, user=None, extra=None, save=True)
SuppliedProduct.log_entries
SuppliedProduct.objects = <django.db.models.manager.Manager object>
SuppliedProduct.product
SuppliedProduct.supplier
class shuup.core.models.Supplier(id, identifier, name, type, stock_managed, module_identifier, module_data)

Bases: shuup.core.modules.interface.ModuleInterface, shuup.core.models.ShuupModel

Parameters:
  • id (AutoField) – Id
  • identifier (InternalIdentifierField) – Do not change this value if you are not sure what you are doing.
  • name (CharField) – The product suppliers name. Suppliers can be used manage the inventory of stocked products.
  • type (EnumIntegerField) – The supplier type indicates whether the products are supplied through an internal supplier or an external supplier.
  • stock_managed (BooleanField) – Check this if this supplier will be used to manage the inventory of stocked products.
  • module_identifier (CharField) – Select the supplier module to use for this supplier. Supplier modules define the rules by which inventory is managed.
  • module_data (JSONField) – Module data
shipments

ManyToOneRel to shuup.core.models.Shipment

order_lines

ManyToOneRel to shuup.core.models.OrderLine

log_entries

ManyToOneRel to shuup.core.models._suppliers.SupplierLogEntry

suppliedproduct_set

ManyToOneRel to shuup.core.models.SuppliedProduct

stockadjustment_set

ManyToOneRel to shuup.simple_supplier.models.StockAdjustment

stockcount_set

ManyToOneRel to shuup.simple_supplier.models.StockCount

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception Supplier.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

Supplier.add_log_entry(message, identifier=None, kind=<LogEntryKind.OTHER: 0>, user=None, extra=None, save=True)
Supplier.adjust_stock(product_id, delta, created_by=None, type=None)[source]
Supplier.default_module_spec = 'shuup.core.suppliers:BaseSupplierModule'
Supplier.get_orderability_errors(shop_product, quantity, customer)[source]
Parameters:
Return type:

iterable[ValidationError]

Supplier.get_stock_status(product_id)[source]
Parameters:product_id (int) – Product ID
Return type:shuup.core.stocks.ProductStockStatus
Supplier.get_stock_statuses(product_ids)[source]
Parameters:product_ids – Iterable of product IDs
Returns:Dict of {product_id: ProductStockStatus}
Return type:dict[int, shuup.core.stocks.ProductStockStatus]
Supplier.get_suppliable_products(shop, customer)[source]
Parameters:
Return type:

list[int]

Supplier.get_type_display(*moreargs, **morekwargs)
Supplier.log_entries
Supplier.module_data

A placeholder class that provides a way to set the attribute on the model.

Supplier.module_provides_key = 'supplier_module'
Supplier.objects = <django.db.models.manager.Manager object>
Supplier.order_lines
Supplier.shipments
Supplier.shop_products
Supplier.stockadjustment_set
Supplier.stockcount_set
Supplier.suppliedproduct_set
Supplier.type

A placeholder class that provides a way to set the attribute on the model.

Supplier.update_stock(product_id)[source]
Supplier.update_stocks(product_ids)[source]
class shuup.core.models.SupplierType

Bases: enumfields.enums.Enum

An enumeration.

EXTERNAL = <SupplierType.EXTERNAL: 2>
INTERNAL = <SupplierType.INTERNAL: 1>
class shuup.core.models.Tax(id, code, rate, amount_value, currency, enabled)

Bases: shuup.utils.properties.MoneyPropped, shuup.core.models._base.ChangeProtected, shuup.core.models.TranslatableShuupModel

Parameters:
  • id (AutoField) – Id
  • code (InternalIdentifierField) – The abbreviated tax code name.
  • rate (DecimalField) – The percentage rate of the tax.
  • amount_value (MoneyValueField) – The flat amount of the tax. Mutually exclusive with percentage rates.
  • currency (CurrencyField) – Currency of tax amount
  • enabled (BooleanField) – Check this if this tax is valid and active.
  • name (CharField) – (Translatable) The tax name. This is shown in order lines in order invoices and confirmations.
order_line_taxes

ManyToOneRel to shuup.core.models.OrderLineTax

translations

ManyToOneRel to shuup.core.models._taxes.TaxTranslation

log_entries

ManyToOneRel to shuup.core.models._taxes.TaxLogEntry

taxrule_set

ManyToOneRel to shuup.default_tax.models.TaxRule

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception Tax.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

Tax.add_log_entry(message, identifier=None, kind=<LogEntryKind.OTHER: 0>, user=None, extra=None, save=True)
Tax.amount

Property for a Money amount.

Will return Money objects when the property is being get and accepts Money objects on set. Value and currency are read/written from/to other fields.

Fields are given as locators, that is a string in dotted format, e.g. locator "foo.bar" points to instance.foo.bar where instance is an instance of the class owning the MoneyProperty.

Setting value of this property to a Money object with different currency that is currently set (in the field pointed by the currency locator), will raise an UnitMixupError.

Tax.calculate_amount(base_amount)[source]

Calculate tax amount with this tax for given base amount.

Return type:shuup.utils.money.Money
Tax.change_protect_message = <django.utils.functional.lazy.<locals>.__proxy__ object>
Tax.clean()[source]
Tax.identifier_attr = 'code'
Tax.log_entries
Tax.name

Descriptor for translated attributes.

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

Tax.objects = <parler.managers.TranslatableManager object>
Tax.order_line_taxes
Tax.taxrule_set
Tax.translations
Tax.unprotected_fields = ['enabled']
class shuup.core.models.TaxClass(id, identifier, enabled)

Bases: shuup.core.models.TranslatableShuupModel

Parameters:
  • id (AutoField) – Id
  • identifier (InternalIdentifierField) – Do not change this value if you are not sure what you are doing.
  • enabled (BooleanField) – Check this if this tax class is active and valid.
  • name (CharField) – (Translatable) The tax class name. Tax classes are used to control how taxes are applied to products.
product_set

ManyToOneRel to shuup.core.models.Product

translations

ManyToOneRel to shuup.core.models._taxes.TaxClassTranslation

log_entries

ManyToOneRel to shuup.core.models._taxes.TaxClassLogEntry

paymentmethod_set

ManyToOneRel to shuup.core.models.PaymentMethod

shippingmethod_set

ManyToOneRel to shuup.core.models.ShippingMethod

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception TaxClass.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

TaxClass.add_log_entry(message, identifier=None, kind=<LogEntryKind.OTHER: 0>, user=None, extra=None, save=True)
TaxClass.log_entries
TaxClass.name

Descriptor for translated attributes.

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

TaxClass.objects = <parler.managers.TranslatableManager object>
TaxClass.paymentmethod_set
TaxClass.product_set
TaxClass.shippingmethod_set
TaxClass.taxrule_set
TaxClass.translations
class shuup.core.models.TranslatableShuupModel(*args, **kwargs)

Bases: shuup.core.models.ShuupModel, parler.models.TranslatableModel

class Meta[source]

Bases: object

abstract = False
TranslatableShuupModel.name_attr = 'name'
TranslatableShuupModel.objects
class shuup.core.models.UnitInterface(internal_unit=None, display_unit=None)

Bases: object

Interface to unit functions.

Provides methods for rounding, rendering and converting product quantities in display unit or internal unit.

Initialize unit interface.

allow_bare_number

Allow showing values without the unit symbol.

Return type:bool
comparison_quantity

Quantity (in internal unit) to use as the unit in unit prices.

Return type:Decimal
Returns:Quantity, in internal unit
display_precision

Smallest possible non-zero quantity in the display unit.

from_display(display_quantity, rounding='ROUND_HALF_UP')[source]

Convert quantity from display unit to internal unit.

Parameters:quantity (Decimal) – Quantity to convert, in display unit
Return type:Decimal
Returns:Converted quantity, in internal unit
get_per_values(force_symbol=False)[source]

Get “per” quantity and “per” text according to the display unit.

Useful when rendering unit prices, e.g.:

(per_qty, per_text) = unit.get_per_values(force_symbol=True)
price = product.get_price(quantity=per_qty)
unit_price_text = _("{price} per {per_text}").format(
    price=price, per_text=per_text)
Return type:(Decimal, str)
Returns:Quantity (in internal unit) and text to use as the unit in unit prices
get_symbol(allow_empty=True)[source]

Get symbol of the display unit or empty if it is not needed.

Return type:str
internal_symbol

Symbol of the internal unit.

Return type:str
render_quantity(quantity, force_symbol=False)[source]

Render (internal unit) quantity in the display unit.

The value is converted from the internal unit to the display unit and then localized. The display unit symbol is added if needed.

Parameters:
  • quantity (Decimal) – Quantity to render, in internal unit
  • force_symbol (bool) – Make sure that the symbol is rendered
Return type:

str

Returns:

Rendered quantity in display unit.

render_quantity_internal(quantity, force_symbol=False)[source]

Render quantity (in internal unit) in the internal unit.

The value is rounded, localized and the internal unit symbol is added if needed.

Parameters:
  • quantity (Decimal) – Quantity to render, in internal unit
  • force_symbol (bool) – Make sure that the symbol is rendered
Return type:

str

Returns:

Rendered quantity in internal unit.

symbol

Symbol of the display unit.

Return type:str
to_display(quantity, rounding='ROUND_HALF_UP')[source]

Convert quantity from internal unit to display unit.

Parameters:quantity (Decimal) – Quantity to convert, in internal unit
Return type:Decimal
Returns:Converted quantity, in display unit
class shuup.core.models.WaivingCostBehaviorComponent(id, polymorphic_ctype, servicebehaviorcomponent_ptr, price_value, waive_limit_value)

Bases: shuup.core.models._service_base.TranslatableServiceBehaviorComponent

Parameters:
translations

ManyToOneRel to shuup.core.models._service_behavior.WaivingCostBehaviorComponentTranslation

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception WaivingCostBehaviorComponent.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

WaivingCostBehaviorComponent.base_objects = <parler.managers.TranslatableManager object>
WaivingCostBehaviorComponent.description

Descriptor for translated attributes.

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

WaivingCostBehaviorComponent.get_costs(service, source)[source]
WaivingCostBehaviorComponent.help_text = <django.utils.functional.lazy.<locals>.__proxy__ object>
WaivingCostBehaviorComponent.name = <django.utils.functional.lazy.<locals>.__proxy__ object>
WaivingCostBehaviorComponent.objects = <shuup.core.models._base._PolyTransManager object>
WaivingCostBehaviorComponent.polymorphic_primary_key_name = 'id'
WaivingCostBehaviorComponent.polymorphic_super_sub_accessors_replaced = False
WaivingCostBehaviorComponent.servicebehaviorcomponent_ptr
WaivingCostBehaviorComponent.translations
class shuup.core.models.WeightBasedPriceRange(id, component, min_value, max_value, price_value)

Bases: parler.models.TranslatableModel

Parameters:
  • id (AutoField) – Id
  • component (ForeignKey to shuup.core.models.WeightBasedPricingBehaviorComponent) – Component
  • min_value (MeasurementField) – The minimum weight, in grams, for this price to apply.
  • max_value (MeasurementField) – The maximum weight, in grams, before this price no longer applies.
  • price_value (MoneyValueField) – The cost to apply to this service when the weight criteria is met.
  • description (CharField) – (Translatable) The order line text to display when this behavior is applied.
translations

ManyToOneRel to shuup.core.models._service_behavior.WeightBasedPriceRangeTranslation

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception WeightBasedPriceRange.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

WeightBasedPriceRange.component
WeightBasedPriceRange.description

Descriptor for translated attributes.

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

WeightBasedPriceRange.matches_to_value(value)[source]
WeightBasedPriceRange.objects = <parler.managers.TranslatableManager object>
WeightBasedPriceRange.translations
class shuup.core.models.WeightBasedPricingBehaviorComponent(id, polymorphic_ctype, servicebehaviorcomponent_ptr)

Bases: shuup.core.models.ServiceBehaviorComponent

Parameters:
ranges

ManyToOneRel to shuup.core.models.WeightBasedPriceRange

exception DoesNotExist

Bases: shuup.core.models._service_base.DoesNotExist

exception WeightBasedPricingBehaviorComponent.MultipleObjectsReturned

Bases: shuup.core.models._service_base.MultipleObjectsReturned

WeightBasedPricingBehaviorComponent.base_objects = <django.db.models.manager.Manager object>
WeightBasedPricingBehaviorComponent.get_costs(service, source)[source]
WeightBasedPricingBehaviorComponent.get_unavailability_reasons(service, source)[source]
WeightBasedPricingBehaviorComponent.help_text = <django.utils.functional.lazy.<locals>.__proxy__ object>
WeightBasedPricingBehaviorComponent.name = <django.utils.functional.lazy.<locals>.__proxy__ object>
WeightBasedPricingBehaviorComponent.objects = <polymorphic.managers.PolymorphicManager object>
WeightBasedPricingBehaviorComponent.polymorphic_primary_key_name = 'id'
WeightBasedPricingBehaviorComponent.polymorphic_super_sub_accessors_replaced = False
WeightBasedPricingBehaviorComponent.ranges
WeightBasedPricingBehaviorComponent.servicebehaviorcomponent_ptr
class shuup.core.models.WeightLimitsBehaviorComponent(id, polymorphic_ctype, servicebehaviorcomponent_ptr, min_weight, max_weight)

Bases: shuup.core.models.ServiceBehaviorComponent

Parameters:
exception DoesNotExist

Bases: shuup.core.models._service_base.DoesNotExist

exception WeightLimitsBehaviorComponent.MultipleObjectsReturned

Bases: shuup.core.models._service_base.MultipleObjectsReturned

WeightLimitsBehaviorComponent.base_objects = <django.db.models.manager.Manager object>
WeightLimitsBehaviorComponent.get_unavailability_reasons(service, source)[source]
WeightLimitsBehaviorComponent.help_text = <django.utils.functional.lazy.<locals>.__proxy__ object>
WeightLimitsBehaviorComponent.name = <django.utils.functional.lazy.<locals>.__proxy__ object>
WeightLimitsBehaviorComponent.objects = <polymorphic.managers.PolymorphicManager object>
WeightLimitsBehaviorComponent.polymorphic_primary_key_name = 'id'
WeightLimitsBehaviorComponent.polymorphic_super_sub_accessors_replaced = False
WeightLimitsBehaviorComponent.servicebehaviorcomponent_ptr