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
  • created_on (DateTimeField) – Created on
  • modified_on (DateTimeField) – Modified on
  • labels (ManyToManyField to shuup.core.models.Label) – Labels
class Meta[source]

Bases: object

abstract = False
verbose_name = 'order line'
verbose_name_plural = 'order lines'
accounting_identifier

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

base_unit_price

Property for Price object.

Similar to MoneyProperty, but also has includes_tax field.

Operaters with TaxfulPrice and TaxlessPrice objects.

base_unit_price_value

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

created_on

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

discount_amount

Property for Price object.

Similar to MoneyProperty, but also has includes_tax field.

Operaters with TaxfulPrice and TaxlessPrice objects.

discount_amount_value

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

extra_data

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

get_next_by_created_on(*, field=<django.db.models.fields.DateTimeField: created_on>, is_next=True, **kwargs)
get_next_by_modified_on(*, field=<django.db.models.fields.DateTimeField: modified_on>, is_next=True, **kwargs)
get_previous_by_created_on(*, field=<django.db.models.fields.DateTimeField: created_on>, is_next=False, **kwargs)
get_previous_by_modified_on(*, field=<django.db.models.fields.DateTimeField: modified_on>, is_next=False, **kwargs)
get_type_display(*, field=<enumfields.fields.EnumIntegerField: type>)
labels

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

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

max_refundable_amount
Return type:shuup.utils.money.Money
max_refundable_quantity
modified_on

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

objects
ordering

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

parent_line

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

parent_line_id

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

product

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

product_id

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

quantity

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

refunded_quantity
require_verification

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

save(*args, **kwargs)[source]
shipped_quantity
sku

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

supplier

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

supplier_id

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

tax_amount
Return type:shuup.utils.money.Money
text

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

type

A property descriptor which ensures that field.to_python() is called on _every_ assignment to the field.

This used to be provided by the django.db.models.subclassing.Creator class, which in turn was used by the deprecated-in-Django-1.10 SubfieldBase class, hence the reimplementation here.

verified

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

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

amount_value

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

created_on

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

description

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

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.

foreign_amount_value

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

foreign_currency

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

gateway_id

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

get_next_by_created_on(*, field=<django.db.models.fields.DateTimeField: created_on>, is_next=True, **kwargs)
get_previous_by_created_on(*, field=<django.db.models.fields.DateTimeField: created_on>, is_next=False, **kwargs)
payment_identifier

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

class shuup.core.models.AnonymousContact(id, polymorphic_ctype, created_on, modified_on, identifier, is_active, registration_shop, 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, options, picture, 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
  • modified_on (DateTimeField) – Modified on
  • identifier (InternalIdentifierField) – Do not change this value if you are not sure what you are doing.
  • is_active (BooleanField) – Enable this if the contact is an active customer.
  • registration_shop (ForeignKey to shuup.core.models.Shop) – Registration shop
  • 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) – Enable 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 contact’s orders. Tax groups are defined in Customer Tax Groups and can be applied to tax rules in 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
  • options (PolymorphicJSONField) – Options
  • picture (FilerImageField to filer.models.imagemodels.Image) – Contact picture. Can be used alongside contact profile, reviews and messages for example.
  • shops (ManyToManyField to shuup.core.models.Shop) – Inform which shops have access to this contact.
  • 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

creted_tasks

ManyToOneRel to shuup.tasks.models.Task

assigned_tasks

ManyToOneRel to shuup.tasks.models.Task

completed_tasks

ManyToOneRel to shuup.tasks.models.Task

task_comments

ManyToOneRel to shuup.tasks.models.TaskComment

contact_discounts

ManyToOneRel to shuup.discounts.models._discounts.Discount

exception DoesNotExist

Bases: shuup.core.models._contacts.DoesNotExist

exception MultipleObjectsReturned

Bases: shuup.core.models._contacts.MultipleObjectsReturned

contact_ptr

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

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Restaurant.place is a ForwardOneToOneDescriptor instance.

contact_ptr_id

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

default_contact_group_identifier = 'default_anonymous_group'
default_contact_group_name = 'Anonymous Contacts'
delete(*args, **kwargs)[source]
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
id = None
is_anonymous = True
pk = None
polymorphic_primary_key_name = 'id'
polymorphic_super_sub_accessors_replaced = False
save(*args, **kwargs)[source]
class shuup.core.models.Attribute(id, identifier, searchable, type, min_choices, max_choices, visibility_mode, ordering)

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 in your store.
  • type (EnumIntegerField) – The attribute data type. Attribute values can be set on the product editor page.
  • min_choices (PositiveIntegerField) – Minimum amount of choices that user can choose from existing options. This field has affect only for choices type.
  • max_choices (PositiveIntegerField) – Maximum amount of choices that user can choose from existing options. This field has affect only for choices type.
  • 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.
  • ordering (IntegerField) – The ordering in which your attribute will be displayed.
  • 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

choices

ManyToOneRel to shuup.core.models.AttributeChoiceOption

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 MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

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

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

In the example:

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

Parent.children is a ReverseManyToOneDescriptor instance.

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

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
get_type_display(*, field=<enumfields.fields.EnumIntegerField: type>)
get_visibility_mode_display(*, field=<enumfields.fields.EnumIntegerField: visibility_mode>)
id

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

identifier

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

is_choices
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
is_numeric
is_stringy
is_temporal
is_translated
log_entries

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

In the example:

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

Parent.children is a ReverseManyToOneDescriptor instance.

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

max_choices

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

min_choices

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

name

Descriptor for translated attributes.

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

objects = <django.db.models.manager.ManagerFromAttributeQuerySet object>
ordering

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

product_types

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

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

productattribute_set

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

In the example:

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

Parent.children is a ReverseManyToOneDescriptor instance.

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

save(*args, **kwargs)[source]
searchable

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

translations

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

In the example:

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

Parent.children is a ReverseManyToOneDescriptor instance.

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

type

A property descriptor which ensures that field.to_python() is called on _every_ assignment to the field.

This used to be provided by the django.db.models.subclassing.Creator class, which in turn was used by the deprecated-in-Django-1.10 SubfieldBase class, hence the reimplementation here.

visibility_mode

A property descriptor which ensures that field.to_python() is called on _every_ assignment to the field.

This used to be provided by the django.db.models.subclassing.Creator class, which in turn was used by the deprecated-in-Django-1.10 SubfieldBase class, hence the reimplementation here.

class shuup.core.models.AttributeChoiceOption(id, attribute)

Bases: parler.models.TranslatableModel

Parameters:
  • id (AutoField) – Id
  • attribute (ForeignKey to shuup.core.models.Attribute) – Attribute
  • name (CharField) – (Translatable) The attribute choice option name.
translations

ManyToOneRel to shuup.core.models._attributes.AttributeChoiceOptionTranslation

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

attribute

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

attribute_id

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

id

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

name

Descriptor for translated attributes.

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

productattribute_set

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

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

translations

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

In the example:

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

Parent.children is a ReverseManyToOneDescriptor instance.

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

class shuup.core.models.AttributeType

Bases: enumfields.enums.Enum

An enumeration.

BOOLEAN = 2
CHOICES = 22
DATE = 11
DATETIME = 10
DECIMAL = 3
INTEGER = 1
TIMEDELTA = 4
TRANSLATED_STRING = 20
UNTRANSLATED_STRING = 21
class shuup.core.models.AttributeVisibility

Bases: enumfields.enums.Enum

An enumeration.

HIDDEN = 0
NOT_VISIBLE = 3
SEARCHABLE_FIELD = 2
SHOW_ON_PRODUCT_PAGE = 1
class shuup.core.models.BackgroundTask(id, queue, identifier, created_on, modified_on, function, arguments, shop, supplier, user)

Bases: django.db.models.base.Model

Parameters:
  • id (AutoField) – Id
  • queue (CharField) – Queue name
  • identifier (CharField) – Task identifier
  • created_on (DateTimeField) – Created on
  • modified_on (DateTimeField) – Modified on
  • function (TextField) – Task function
  • arguments (JSONField) – Task arguments
  • shop (ForeignKey to shuup.core.models.Shop) – Shop
  • supplier (ForeignKey to shuup.core.models.Supplier) – Supplier
  • user (ForeignKey to django.contrib.auth.models.User) – User
executions

ManyToOneRel to shuup.core.models.BackgroundTaskExecution

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

arguments

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

created_on

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

executions

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

In the example:

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

Parent.children is a ReverseManyToOneDescriptor instance.

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

function

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

get_next_by_created_on(*, field=<django.db.models.fields.DateTimeField: created_on>, is_next=True, **kwargs)
get_next_by_modified_on(*, field=<django.db.models.fields.DateTimeField: modified_on>, is_next=True, **kwargs)
get_previous_by_created_on(*, field=<django.db.models.fields.DateTimeField: created_on>, is_next=False, **kwargs)
get_previous_by_modified_on(*, field=<django.db.models.fields.DateTimeField: modified_on>, is_next=False, **kwargs)
id

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

identifier

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

modified_on

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

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

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

shop

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

shop_id

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

supplier

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

supplier_id

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

user

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

user_id

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

class shuup.core.models.BackgroundTaskExecution(id, task, started_on, finished_on, status, result, error_log)

Bases: django.db.models.base.Model

Parameters:
  • id (AutoField) – Id
  • task (ForeignKey to shuup.core.models.BackgroundTask) – Background task
  • started_on (DateTimeField) – Started on
  • finished_on (DateTimeField) – Finished on
  • status (EnumIntegerField) – Status
  • result (JSONField) – Results
  • error_log (TextField) – Error log
exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

error_log

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

finished_on

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

get_next_by_started_on(*, field=<django.db.models.fields.DateTimeField: started_on>, is_next=True, **kwargs)
get_previous_by_started_on(*, field=<django.db.models.fields.DateTimeField: started_on>, is_next=False, **kwargs)
get_status_display(*, field=<enumfields.fields.EnumIntegerField: status>)
id

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

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

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

started_on

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

status

A property descriptor which ensures that field.to_python() is called on _every_ assignment to the field.

This used to be provided by the django.db.models.subclassing.Creator class, which in turn was used by the deprecated-in-Django-1.10 SubfieldBase class, hence the reimplementation here.

task

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

task_id

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

class shuup.core.models.BackgroundTaskExecutionStatus

Bases: enumfields.enums.Enum

An enumeration.

ERROR = 2
Label = <class 'shuup.core.models._background_tasks.BackgroundTaskExecutionStatus.Label'>
RUNNING = 0
SUCCESS = 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:
  • id (AutoField) – Id
  • key (CharField) – Key
  • shop (ForeignKey to shuup.core.models.Shop) – Shop
  • customer (ForeignKey to shuup.core.models.Contact) – Customer
  • orderer (ForeignKey to shuup.core.models.PersonContact) – Orderer
  • creator (ForeignKey to django.contrib.auth.models.User) – Creator
  • created_on (DateTimeField) – Created on
  • updated_on (DateTimeField) – Updated on
  • persistent (BooleanField) – Persistent
  • deleted (BooleanField) – Deleted
  • finished (BooleanField) – Finished
  • title (CharField) – Title
  • data (TaggedJSONField) – Data
  • taxless_total_price_value (MoneyValueField) – Taxless total price
  • taxful_total_price_value (MoneyValueField) – Taxful total price
  • currency (CurrencyField) – Currency
  • prices_include_tax (BooleanField) – Prices include tax
  • product_count (IntegerField) – Product_count
  • products (ManyToManyField to shuup.core.models.Product) – Products
exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

created_on

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

creator

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

creator_id

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

currency

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

customer

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

customer_id

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

data

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

deleted

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

finished

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

get_next_by_created_on(*, field=<django.db.models.fields.DateTimeField: created_on>, is_next=True, **kwargs)
get_next_by_updated_on(*, field=<django.db.models.fields.DateTimeField: updated_on>, is_next=True, **kwargs)
get_previous_by_created_on(*, field=<django.db.models.fields.DateTimeField: created_on>, is_next=False, **kwargs)
get_previous_by_updated_on(*, field=<django.db.models.fields.DateTimeField: updated_on>, is_next=False, **kwargs)
id

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

key

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

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

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

orderer_id

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

persistent

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

prices_include_tax

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

product_count

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

products

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

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

shop

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

shop_id

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

taxful_total_price
taxful_total_price_value

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

taxless_total_price
taxless_total_price_value

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

title

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

updated_on

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

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 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) – Enable this if this service provider can be used when placing orders.
  • logo (FilerImageField to filer.models.imagemodels.Image) – Logo
  • supplier (ForeignKey to shuup.core.models.Supplier) – This service provider will be available only for order sources that contain all items from the configured supplier. If blank, this service provider is available for any order source.
  • shops (ManyToManyField to shuup.core.models.Shop) – This service provider will be available only for order sources of the given shop. If blank, this service provider is available for any order source.
  • 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) – Enable this if this service provider can be used when placing orders.
  • logo (FilerImageField to filer.models.imagemodels.Image) – Logo
  • supplier (ForeignKey to shuup.core.models.Supplier) – This service provider will be available only for order sources that contain all items from the configured supplier. If blank, this service provider is available for any order source.
  • shops (ManyToManyField to shuup.core.models.Shop) – This service provider will be available only for order sources of the given shop. If blank, this service provider is available for any order source.
  • 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 MultipleObjectsReturned

Bases: shuup.core.models._service_base.MultipleObjectsReturned

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

Accessor to the related object on the reverse side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Place.restaurant is a ReverseOneToOneDescriptor instance.

delete(*args, **kwargs)[source]
log_entries

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

In the example:

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

Parent.children is a ReverseManyToOneDescriptor instance.

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

polymorphic_primary_key_name = 'id'
polymorphic_super_sub_accessors_replaced = False
service_model

alias of ShippingMethod

serviceprovider_ptr

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

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Restaurant.place is a ForwardOneToOneDescriptor instance.

serviceprovider_ptr_id

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

shippingmethod_set

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

In the example:

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

Parent.children is a ReverseManyToOneDescriptor instance.

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

uses_default_shipments_manager = True
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) – Choose if you want this category to be visible in your store.
  • image (FilerImageField to filer.models.imagemodels.Image) – Category image. Will be shown in places defined by the graphical theme in use.
  • ordering (IntegerField) – You can assign numerical values to images to tell the order in which they shall be displayed on the vendor page. You can also use the Organize button in the list view to order them visually with a drag-and-drop.
  • 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 certain customer group.
  • visible_in_menu (BooleanField) – Enable if this category should be visible in the store front’s 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 want to see this category. There are three groups created by default: Company, Person, Anonymous. In addition you can also define custom groups by searching for Contact Groups.
  • name (CharField) – (Translatable) Enter a descriptive name for your product category. Products can be found in the store front under the defined product category either directly in menus or while searching.
  • 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. Slug is user- and search engine-friendly short text used in a URL to identify and describe a resource. In this case it will determine what your product category page URL in the browser address bar will look like. 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

discountfromcategoryproducts_set

ManyToOneRel to shuup.campaigns.models.basket_line_effects.DiscountFromCategoryProducts

category_discounts

ManyToOneRel to shuup.discounts.models._discounts.Discount

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

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

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

In the example:

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

Parent.children is a ReverseManyToOneDescriptor instance.

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

categoryfilter_set

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

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

children

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

In the example:

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

Parent.children is a ReverseManyToOneDescriptor instance.

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

delete(using=None)[source]
description

Descriptor for translated attributes.

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

discountfromcategoryproducts_set

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

In the example:

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

Parent.children is a ReverseManyToOneDescriptor instance.

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

get_cached_children()[source]
get_hierarchy(reverse=True)[source]
get_status_display(*, field=<enumfields.fields.EnumIntegerField: status>)
get_visibility_display(*, field=<enumfields.fields.EnumIntegerField: visibility>)
id

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

identifier

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

image

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

image_id

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

is_visible(customer)[source]
level

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

lft

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

log_entries

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

In the example:

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

Parent.children is a ReverseManyToOneDescriptor instance.

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

name

Descriptor for translated attributes.

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

objects = <shuup.core.models._categories.CategoryManager object>
ordering

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

parent

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

parent_id

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

primary_shop_products

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

In the example:

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

Parent.children is a ReverseManyToOneDescriptor instance.

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

rght

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

save(*args, **kwargs)[source]
shop_products

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

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

shops

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

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

slug

Descriptor for translated attributes.

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

soft_delete(user=None)[source]
status

A property descriptor which ensures that field.to_python() is called on _every_ assignment to the field.

This used to be provided by the django.db.models.subclassing.Creator class, which in turn was used by the deprecated-in-Django-1.10 SubfieldBase class, hence the reimplementation here.

translations

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

In the example:

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

Parent.children is a ReverseManyToOneDescriptor instance.

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

tree_id

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

visibility

A property descriptor which ensures that field.to_python() is called on _every_ assignment to the field.

This used to be provided by the django.db.models.subclassing.Creator class, which in turn was used by the deprecated-in-Django-1.10 SubfieldBase class, hence the reimplementation here.

visibility_groups

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

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

visible_in_menu

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

class shuup.core.models.CategoryStatus

Bases: enumfields.enums.Enum

An enumeration.

DELETED = 2
INVISIBLE = 0
VISIBLE = 1
class shuup.core.models.CategoryVisibility

Bases: enumfields.enums.Enum

An enumeration.

VISIBLE_TO_ALL = 1
VISIBLE_TO_GROUPS = 3
VISIBLE_TO_LOGGED_IN = 2
class shuup.core.models.CompanyContact(id, polymorphic_ctype, created_on, modified_on, identifier, is_active, registration_shop, 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, options, picture, 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
  • modified_on (DateTimeField) – Modified on
  • identifier (InternalIdentifierField) – Do not change this value if you are not sure what you are doing.
  • is_active (BooleanField) – Enable this if the contact is an active customer.
  • registration_shop (ForeignKey to shuup.core.models.Shop) – Registration shop
  • 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) – Enable 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 contact’s orders. Tax groups are defined in Customer Tax Groups and can be applied to tax rules in 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
  • options (PolymorphicJSONField) – Options
  • picture (FilerImageField to filer.models.imagemodels.Image) – Contact picture. Can be used alongside contact profile, reviews and messages for example.
  • shops (ManyToManyField to shuup.core.models.Shop) – Inform which shops have access to this contact.
  • 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

creted_tasks

ManyToOneRel to shuup.tasks.models.Task

assigned_tasks

ManyToOneRel to shuup.tasks.models.Task

completed_tasks

ManyToOneRel to shuup.tasks.models.Task

task_comments

ManyToOneRel to shuup.tasks.models.TaskComment

contact_discounts

ManyToOneRel to shuup.discounts.models._discounts.Discount

log_entries

ManyToOneRel to shuup.core.models.CompanyContactLogEntry

exception DoesNotExist

Bases: shuup.core.models._contacts.DoesNotExist

exception MultipleObjectsReturned

Bases: shuup.core.models._contacts.MultipleObjectsReturned

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

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

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Restaurant.place is a ForwardOneToOneDescriptor instance.

contact_ptr_id

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

default_contact_group_identifier = 'default_company_group'
default_contact_group_name = 'Company Contacts'
default_tax_group_getter()
full_name
log_entries

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

In the example:

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

Parent.children is a ReverseManyToOneDescriptor instance.

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

members

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

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

polymorphic_primary_key_name = 'id'
polymorphic_super_sub_accessors_replaced = False
tax_number

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

class shuup.core.models.CompanyContactLogEntry(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.CompanyContact) – Target
exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

extra

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

get_next_by_created_on(*, field=<django.db.models.fields.DateTimeField: created_on>, is_next=True, **kwargs)
get_previous_by_created_on(*, field=<django.db.models.fields.DateTimeField: created_on>, is_next=False, **kwargs)
id

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

kind

A property descriptor which ensures that field.to_python() is called on _every_ assignment to the field.

This used to be provided by the django.db.models.subclassing.Creator class, which in turn was used by the deprecated-in-Django-1.10 SubfieldBase class, hence the reimplementation here.

logged_model

alias of CompanyContact

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

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

target_id

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

user

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

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 MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

id

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

key

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

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

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

shop_id

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

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, modified_on, identifier, is_active, registration_shop, 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, options, picture)

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
  • modified_on (DateTimeField) – Modified on
  • identifier (InternalIdentifierField) – Do not change this value if you are not sure what you are doing.
  • is_active (BooleanField) – Enable this if the contact is an active customer.
  • registration_shop (ForeignKey to shuup.core.models.Shop) – Registration shop
  • 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) – Enable 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 contact’s orders. Tax groups are defined in Customer Tax Groups and can be applied to tax rules in 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
  • options (PolymorphicJSONField) – Options
  • picture (FilerImageField to filer.models.imagemodels.Image) – Contact picture. Can be used alongside contact profile, reviews and messages for example.
  • shops (ManyToManyField to shuup.core.models.Shop) – Inform which shops have access to this 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

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

creted_tasks

ManyToOneRel to shuup.tasks.models.Task

assigned_tasks

ManyToOneRel to shuup.tasks.models.Task

completed_tasks

ManyToOneRel to shuup.tasks.models.Task

task_comments

ManyToOneRel to shuup.tasks.models.TaskComment

contact_discounts

ManyToOneRel to shuup.discounts.models._discounts.Discount

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

account_manager

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

account_manager_id

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

add_to_shop(shop)[source]
add_to_shops(registration_shop, shops)[source]

Add contact to multiple shops

Parameters:
  • registration_shop (core.models.Shop) – Shop where contact registers.
  • shops (list) – A list of shops.
Returns:

anonymouscontact

Accessor to the related object on the reverse side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Place.restaurant is a ReverseOneToOneDescriptor instance.

assigned_tasks

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

In the example:

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

Parent.children is a ReverseManyToOneDescriptor instance.

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

company_memberships

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

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

companycontact

Accessor to the related object on the reverse side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Place.restaurant is a ReverseOneToOneDescriptor instance.

completed_tasks

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

In the example:

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

Parent.children is a ReverseManyToOneDescriptor instance.

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

contact_discounts

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

In the example:

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

Parent.children is a ReverseManyToOneDescriptor instance.

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

contactbasketcondition_set

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

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

contactcondition_set

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

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

created_on

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

creted_tasks

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

In the example:

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

Parent.children is a ReverseManyToOneDescriptor instance.

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

customer_baskets

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

In the example:

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

Parent.children is a ReverseManyToOneDescriptor instance.

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

customer_core_baskets

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

In the example:

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

Parent.children is a ReverseManyToOneDescriptor instance.

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

customer_orders

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

In the example:

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

Parent.children is a ReverseManyToOneDescriptor instance.

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

default_billing_address

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

default_billing_address_id

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

default_contact_group_identifier = None
default_contact_group_name = None
default_group
default_payment_method

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

default_payment_method_id

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

default_shipping_address

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

default_shipping_address_id

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

default_shipping_method

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

default_shipping_method_id

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

default_tax_group_getter = None
email

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

full_name
get__language_display(*, field=<shuup.core.fields.LanguageField: _language>)
classmethod 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
get_next_by_created_on(*, field=<django.db.models.fields.DateTimeField: created_on>, is_next=True, **kwargs)
get_previous_by_created_on(*, field=<django.db.models.fields.DateTimeField: created_on>, is_next=False, **kwargs)
get_price_display_options(**kwargs)[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
get_timezone_display(*, field=<timezone_field.fields.TimeZoneField: timezone>)
groups

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

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

groups_ids
id

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

identifier

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

in_shop(shop, only_registration=False)[source]
is_active

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

is_all_seeing = False
is_anonymous = False
language
marketing_permission

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

merchant_notes

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

modified_on

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

name

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

name_ext

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

options

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

personcontact

Accessor to the related object on the reverse side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Place.restaurant is a ReverseOneToOneDescriptor instance.

phone

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

picture

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

picture_id

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

polymorphic_ctype

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

polymorphic_primary_key_name = 'id'
polymorphic_super_sub_accessors_replaced = False
prefix

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

registered_in(shop)[source]
registration_shop

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

registration_shop_id

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

save(*args, **kwargs)[source]
savedaddress_set

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

In the example:

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

Parent.children is a ReverseManyToOneDescriptor instance.

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

shop_set

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

In the example:

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

Parent.children is a ReverseManyToOneDescriptor instance.

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

shops

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

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

suffix

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

task_comments

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

In the example:

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

Parent.children is a ReverseManyToOneDescriptor instance.

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

tax_group

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

tax_group_id

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

timezone

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

www

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

class shuup.core.models.ContactGroup(id, identifier, shop)

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.
  • shop (ForeignKey to shuup.core.models.Shop) – Shop
  • 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 a specific set of users.
price_display_options

ManyToOneRel to shuup.core.models.ContactGroupPriceDisplay

translations

ManyToOneRel to shuup.core.models._contacts.ContactGroupTranslation

log_entries

ManyToOneRel to shuup.core.models.ContactGroupLogEntry

cgpprice_set

ManyToOneRel to shuup.customer_group_pricing.models.CgpPrice

cgpdiscount_set

ManyToOneRel to shuup.customer_group_pricing.models.CgpDiscount

contact_group_discounts

ManyToOneRel to shuup.discounts.models._discounts.Discount

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

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

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

In the example:

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

Parent.children is a ReverseManyToOneDescriptor instance.

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

cgpprice_set

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

In the example:

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

Parent.children is a ReverseManyToOneDescriptor instance.

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

clean()[source]
contact_group_discounts

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

In the example:

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

Parent.children is a ReverseManyToOneDescriptor instance.

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

contactgroupbasketcondition_set

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

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

contactgroupcondition_set

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

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

customer_group_orders

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

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

delete(*args, **kwargs)[source]
get_price_display_options()[source]
groupavailabilitybehaviorcomponent_set

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

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

hide_prices
id

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

identifier

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

is_protected
log_entries

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

In the example:

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

Parent.children is a ReverseManyToOneDescriptor instance.

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

members

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

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

name

Descriptor for translated attributes.

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

objects = <django.db.models.manager.ManagerFromContactGroupQuerySet object>
price_display_options

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

In the example:

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

Parent.children is a ReverseManyToOneDescriptor instance.

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

save(**kwargs)[source]
set_price_display_options(**kwargs)[source]
shop

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

shop_id

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

show_prices_including_taxes
show_pricing
translations

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

In the example:

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

Parent.children is a ReverseManyToOneDescriptor instance.

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

visible_categories

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

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

visible_products

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

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

class shuup.core.models.ContactGroupLogEntry(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.ContactGroup) – Target
exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

extra

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

get_next_by_created_on(*, field=<django.db.models.fields.DateTimeField: created_on>, is_next=True, **kwargs)
get_previous_by_created_on(*, field=<django.db.models.fields.DateTimeField: created_on>, is_next=False, **kwargs)
id

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

kind

A property descriptor which ensures that field.to_python() is called on _every_ assignment to the field.

This used to be provided by the django.db.models.subclassing.Creator class, which in turn was used by the deprecated-in-Django-1.10 SubfieldBase class, hence the reimplementation here.

logged_model

alias of ContactGroup

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

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

target_id

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

user

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

class shuup.core.models.ContactGroupPriceDisplay(id, shop, group, show_pricing, show_prices_including_taxes, hide_prices)

Bases: django.db.models.base.Model

Parameters:
  • id (AutoField) – Id
  • shop (ForeignKey to shuup.core.models.Shop) – Shop
  • group (ForeignKey to shuup.core.models.ContactGroup) – Group
  • show_pricing (BooleanField) – Show as pricing option
  • show_prices_including_taxes (NullBooleanField) – Show prices including taxes
  • hide_prices (NullBooleanField) – Hide prices
exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

group

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

group_id

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

hide_prices

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

id

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

objects = <django.db.models.manager.ManagerFromContactGroupPriceDisplayQueryset object>
shop

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

shop_id

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

show_prices_including_taxes

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

show_pricing

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

to_price_display()[source]
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 MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

classmethod get_and_increment(id)[source]
get_id_display(*, field=<enumfields.fields.EnumIntegerField: id>)
id

A property descriptor which ensures that field.to_python() is called on _every_ assignment to the field.

This used to be provided by the django.db.models.subclassing.Creator class, which in turn was used by the deprecated-in-Django-1.10 SubfieldBase class, hence the reimplementation here.

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

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

class shuup.core.models.CounterType

Bases: enumfields.enums.Enum

An enumeration.

ORDER_REFERENCE = 1
class shuup.core.models.CountryLimitBehaviorComponent(id, polymorphic_ctype, identifier, 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
  • identifier (InternalIdentifierField) – Do not change this value if you are not sure what you are doing.
  • 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 union
  • unavailable_in_countries (JSONField) – Unavailable in countries
  • unavailable_in_european_countries (BooleanField) – Unavailable in european union
exception DoesNotExist

Bases: shuup.core.models._service_base.DoesNotExist

exception MultipleObjectsReturned

Bases: shuup.core.models._service_base.MultipleObjectsReturned

available_in_countries

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

available_in_european_countries

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

get_unavailability_reasons(service, source)[source]
help_text = 'Limit service availability based on countries selected.'
name = 'Country limit'
polymorphic_primary_key_name = 'id'
polymorphic_super_sub_accessors_replaced = False
servicebehaviorcomponent_ptr

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

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Restaurant.place is a ForwardOneToOneDescriptor instance.

servicebehaviorcomponent_ptr_id

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

unavailable_in_countries

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

unavailable_in_european_countries

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

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

Bases: shuup.core.models.Carrier

Carrier without any integration or special processing.

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) – Enable this if this service provider can be used when placing orders.
  • logo (FilerImageField to filer.models.imagemodels.Image) – Logo
  • supplier (ForeignKey to shuup.core.models.Supplier) – This service provider will be available only for order sources that contain all items from the configured supplier. If blank, this service provider is available for any order source.
  • shops (ManyToManyField to shuup.core.models.Shop) – This service provider will be available only for order sources of the given shop. If blank, this service provider is available for any order source.
  • serviceprovider_ptr (OneToOneField to shuup.core.models.ServiceProvider) – Serviceprovider ptr
  • carrier_ptr (OneToOneField to shuup.core.models.Carrier) – Carrier 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

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) – Enable this if this service provider can be used when placing orders.
  • logo (FilerImageField to filer.models.imagemodels.Image) – Logo
  • supplier (ForeignKey to shuup.core.models.Supplier) – This service provider will be available only for order sources that contain all items from the configured supplier. If blank, this service provider is available for any order source.
  • shops (ManyToManyField to shuup.core.models.Shop) – This service provider will be available only for order sources of the given shop. If blank, this service provider is available for any order source.
  • serviceprovider_ptr (OneToOneField to shuup.core.models.ServiceProvider) – Serviceprovider ptr
  • carrier_ptr (OneToOneField to shuup.core.models.Carrier) – Carrier 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

log_entries

ManyToOneRel to shuup.core.models._service_shipping.CarrierLogEntry

exception DoesNotExist

Bases: shuup.core.models._service_shipping.DoesNotExist

exception MultipleObjectsReturned

Bases: shuup.core.models._service_shipping.MultipleObjectsReturned

carrier_ptr

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

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Restaurant.place is a ForwardOneToOneDescriptor instance.

carrier_ptr_id

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

get_service_choices()[source]
polymorphic_primary_key_name = 'id'
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.
order_set

ManyToOneRel to shuup.core.models.Order

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 MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

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

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

In the example:

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

Parent.children is a ReverseManyToOneDescriptor instance.

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

enabled

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

classmethod get_default_company_group()[source]
classmethod get_default_person_group()[source]
id

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

identifier

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

log_entries

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

In the example:

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

Parent.children is a ReverseManyToOneDescriptor instance.

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

name

Descriptor for translated attributes.

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

order_set

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

In the example:

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

Parent.children is a ReverseManyToOneDescriptor instance.

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

taxrule_set

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

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

translations

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

In the example:

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

Parent.children is a ReverseManyToOneDescriptor instance.

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

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 or generally outside the Shuup.

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) – Enable this if this service provider can be used when placing orders.
  • logo (FilerImageField to filer.models.imagemodels.Image) – Logo
  • supplier (ForeignKey to shuup.core.models.Supplier) – This service provider will be available only for order sources that contain all items from the configured supplier. If blank, this service provider is available for any order source.
  • shops (ManyToManyField to shuup.core.models.Shop) – This service provider will be available only for order sources of the given shop. If blank, this service provider is available for any order source.
  • serviceprovider_ptr (OneToOneField to shuup.core.models.ServiceProvider) – Serviceprovider ptr
  • paymentprocessor_ptr (OneToOneField to shuup.core.models.PaymentProcessor) – Paymentprocessor ptr
  • rounding_quantize (DecimalField) – Choose rounding quantize (precision) for cash payment.
  • rounding_mode (EnumField) – Choose 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

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) – Enable this if this service provider can be used when placing orders.
  • logo (FilerImageField to filer.models.imagemodels.Image) – Logo
  • supplier (ForeignKey to shuup.core.models.Supplier) – This service provider will be available only for order sources that contain all items from the configured supplier. If blank, this service provider is available for any order source.
  • shops (ManyToManyField to shuup.core.models.Shop) – This service provider will be available only for order sources of the given shop. If blank, this service provider is available for any order source.
  • serviceprovider_ptr (OneToOneField to shuup.core.models.ServiceProvider) – Serviceprovider ptr
  • paymentprocessor_ptr (OneToOneField to shuup.core.models.PaymentProcessor) – Paymentprocessor ptr
  • rounding_quantize (DecimalField) – Choose rounding quantize (precision) for cash payment.
  • rounding_mode (EnumField) – Choose 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

exception DoesNotExist

Bases: shuup.core.models._service_payment.DoesNotExist

exception MultipleObjectsReturned

Bases: shuup.core.models._service_payment.MultipleObjectsReturned

get_rounding_mode_display(*, field=<enumfields.fields.EnumField: rounding_mode>)
get_service_choices()[source]
paymentprocessor_ptr

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

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Restaurant.place is a ForwardOneToOneDescriptor instance.

paymentprocessor_ptr_id

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

polymorphic_primary_key_name = 'id'
polymorphic_super_sub_accessors_replaced = False
process_payment_return_request(service, order, request)[source]
rounding_mode

A property descriptor which ensures that field.to_python() is called on _every_ assignment to the field.

This used to be provided by the django.db.models.subclassing.Creator class, which in turn was used by the deprecated-in-Django-1.10 SubfieldBase class, hence the reimplementation here.

rounding_quantize

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

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 MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

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

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

decimal_places

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

id

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

identifier_attr = 'code'
log_entries

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

In the example:

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

Parent.children is a ReverseManyToOneDescriptor instance.

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

objects = <django.db.models.manager.Manager object>
save(*args, **kwargs)[source]
class shuup.core.models.DefaultOrderStatus

Bases: enumfields.enums.Enum

An enumeration.

CANCELED = 'canceled'
COMPLETE = 'complete'
INITIAL = 'initial'
NONE = 'none'
PROCESSING = 'processing'
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 the settings of the internal unit.
  • comparison_value (QuantityField) – Value to use when displaying unit prices. E.g. if the display unit is a gram 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 occasionally be shown without the symbol attached to it. E.g. if the unit is a piece, then you might want for the product listings to only show ‘$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 MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

allow_bare_number

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

comparison_value

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

decimals

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

default

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

id

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

internal_unit

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

internal_unit_id

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

name

Descriptor for translated attributes.

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

ratio

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

shopproduct_set

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

In the example:

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

Parent.children is a ReverseManyToOneDescriptor instance.

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

symbol

Descriptor for translated attributes.

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

translations

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

In the example:

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

Parent.children is a ReverseManyToOneDescriptor instance.

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

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

Bases: shuup.core.models._service_base.TranslatableServiceBehaviorComponent

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.
  • servicebehaviorcomponent_ptr (OneToOneField to shuup.core.models.ServiceBehaviorComponent) – Servicebehaviorcomponent ptr
  • price_value (MoneyValueField) – The fixed cost to apply to this service.
  • description (CharField) – (Translatable) The order line text to display when this behavior is applied.
translations

ManyToOneRel to shuup.core.models._service_behavior.FixedCostBehaviorComponentTranslation

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

description

Descriptor for translated attributes.

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

get_costs(service, source)[source]
help_text = 'Add a fixed cost to the price of the service.'
name = 'Fixed cost'
polymorphic_primary_key_name = 'id'
polymorphic_super_sub_accessors_replaced = False
price_value

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

servicebehaviorcomponent_ptr

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

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Restaurant.place is a ForwardOneToOneDescriptor instance.

translations

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

In the example:

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

Parent.children is a ReverseManyToOneDescriptor instance.

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

shuup.core.models.get_all_available_combinations(product)
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_company_contact_for_shop_staff(shop, user)
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 a given currency code or None for unknown.
shuup.core.models.get_groups_for_price_display_create(shop)
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
shuup.core.models.get_price_displays_for_shop(shop)
shuup.core.models.get_price_display_for_group_and_shop(group, shop, create_if_missing=False)
shuup.core.models.get_price_display_options_for_group_and_shop(group, shop=None, create_if_missing=True)
class shuup.core.models.Gender

Bases: enumfields.enums.Enum

An enumeration.

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

Bases: shuup.core.models.ServiceBehaviorComponent

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.
  • servicebehaviorcomponent_ptr (OneToOneField to shuup.core.models.ServiceBehaviorComponent) – Servicebehaviorcomponent ptr
  • groups (ManyToManyField to shuup.core.models.ContactGroup) – The contact groups for which this service is available.
exception DoesNotExist

Bases: shuup.core.models._service_base.DoesNotExist

exception MultipleObjectsReturned

Bases: shuup.core.models._service_base.MultipleObjectsReturned

get_unavailability_reasons(service, source)[source]
groups

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

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

help_text = 'Make service available only for specific contact groups.'
name = 'Contact group availability'
polymorphic_primary_key_name = 'id'
polymorphic_super_sub_accessors_replaced = False
servicebehaviorcomponent_ptr

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

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Restaurant.place is a ForwardOneToOneDescriptor instance.

servicebehaviorcomponent_ptr_id

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

class shuup.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 the USA or VAT code in the EU.
  • 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 MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

billing_orders

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

In the example:

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

Parent.children is a ReverseManyToOneDescriptor instance.

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

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 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
id

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

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

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

In the example:

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

Parent.children is a ReverseManyToOneDescriptor instance.

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

to_immutable()[source]
class shuup.core.models.Label(id, identifier, created_on, modified_on)

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.
  • created_on (DateTimeField) – Created on
  • modified_on (DateTimeField) – Modified on
  • name (CharField) – (Translatable) Name
translations

ManyToOneRel to shuup.core.models._labels.LabelTranslation

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

created_on

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

get_next_by_created_on(*, field=<django.db.models.fields.DateTimeField: created_on>, is_next=True, **kwargs)
get_next_by_modified_on(*, field=<django.db.models.fields.DateTimeField: modified_on>, is_next=True, **kwargs)
get_previous_by_created_on(*, field=<django.db.models.fields.DateTimeField: created_on>, is_next=False, **kwargs)
get_previous_by_modified_on(*, field=<django.db.models.fields.DateTimeField: modified_on>, is_next=False, **kwargs)
id

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

identifier

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

modified_on

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

name

Descriptor for translated attributes.

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

orderline_set

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

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

paymentmethod_set

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

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

shippingmethod_set

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

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

shops

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

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

translations

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

In the example:

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

Parent.children is a ReverseManyToOneDescriptor instance.

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

class shuup.core.models.Manufacturer(id, created_on, identifier, name, url, logo)

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 this 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.
  • logo (FilerImageField to filer.models.imagemodels.Image) – Logo
  • shops (ManyToManyField to shuup.core.models.Shop) – Shops
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 MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

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

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

get_next_by_created_on(*, field=<django.db.models.fields.DateTimeField: created_on>, is_next=True, **kwargs)
get_previous_by_created_on(*, field=<django.db.models.fields.DateTimeField: created_on>, is_next=False, **kwargs)
id

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

identifier

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

log_entries

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

In the example:

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

Parent.children is a ReverseManyToOneDescriptor instance.

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

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

logo_id

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

name

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

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

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

In the example:

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

Parent.children is a ReverseManyToOneDescriptor instance.

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

shops

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

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

url

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

class shuup.core.models.MediaFile(id, file)

Bases: django.db.models.base.Model

Parameters:
  • id (AutoField) – Id
  • file (FilerFileField to filer.models.filemodels.File) – File
  • shops (ManyToManyField to shuup.core.models.Shop) – Select which shops you would like the files to be visible in.
exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

file

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

file_id

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

id

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

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

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

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

class shuup.core.models.MediaFolder(id, folder, visible)

Bases: django.db.models.base.Model

Parameters:
  • id (AutoField) – Id
  • folder (FilerFolderField to filer.models.foldermodels.Folder) – Folder
  • visible (BooleanField) – Should this folder be visible for everyone in the media browser
  • shops (ManyToManyField to shuup.core.models.Shop) – Select which shops you would like the folder to be visible in.
  • owners (ManyToManyField to django.contrib.auth.models.User) – Select which users will own this folder.
exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

folder

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

folder_id

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

get_all_children()[source]
id

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

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

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

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

shops

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

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

visible

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

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 the USA or VAT code in the EU.
  • 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

supplier_addresses

ManyToOneRel to shuup.core.models.Supplier

shop_set

ManyToOneRel to shuup.core.models.Shop

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

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 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
id

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

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

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

In the example:

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

Parent.children is a ReverseManyToOneDescriptor instance.

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

shop_set

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

In the example:

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

Parent.children is a ReverseManyToOneDescriptor instance.

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

supplier_addresses

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

In the example:

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

Parent.children is a ReverseManyToOneDescriptor instance.

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

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, account_manager, tax_group, 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
  • account_manager (ForeignKey to shuup.core.models.PersonContact) – Account manager
  • tax_group (ForeignKey to shuup.core.models.CustomerTaxGroup) – Tax group
  • 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
  • customer_groups (ManyToManyField to shuup.core.models.ContactGroup) – Customer groups
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

discounts_coupon_usages

ManyToOneRel to shuup.discounts.models._coupon_codes.CouponUsage

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

account_manager

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

account_manager_id

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

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

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

all_verified

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

billing_address

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

billing_address_id

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

cache_prices()[source]
can_create_payment()[source]
can_create_refund(supplier=None)[source]
can_create_shipment()[source]
can_edit()[source]
can_set_canceled()[source]
can_set_complete()[source]
check_all_verified()[source]
codes
coupon_usages

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

In the example:

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

Parent.children is a ReverseManyToOneDescriptor instance.

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

create_full_refund(restock_products=False, created_by=None)[source]

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

Parameters:
  • restock_products (bool|False) – Boolean indicating whether to also restock the products.
  • created_by – Refund creator’s user instance, used for adjusting supplier stock.
create_payment(amount, payment_identifier=None, description='')[source]

Create a payment with a 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 a 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

create_refund(refund_data, created_by=None, supplier=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 exact amount set in the order supplier’s 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.
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, which maps 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

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
created_on

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

creator

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

creator_id

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

currency

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

customer

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

customer_comment

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

customer_groups

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

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

customer_id

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

delete(using=None)[source]
deleted

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

discounts_coupon_usages

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

In the example:

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

Parent.children is a ReverseManyToOneDescriptor instance.

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

display_currency

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

display_currency_rate

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

email

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

extra_data

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

full_clean(exclude=None, validate_unique=True)[source]
get_available_payment_methods()[source]

Get available payment methods.

Return type:list[PaymentMethod]
get_available_shipping_methods()[source]

Get available shipping methods.

Return type:list[ShippingMethod]
get_customer_name()[source]
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.

get_language_display(*, field=<shuup.core.fields.LanguageField: language>)
get_next_by_created_on(*, field=<django.db.models.fields.DateTimeField: created_on>, is_next=True, **kwargs)
get_next_by_modified_on(*, field=<django.db.models.fields.DateTimeField: modified_on>, is_next=True, **kwargs)
get_next_by_order_date(*, field=<django.db.models.fields.DateTimeField: order_date>, is_next=True, **kwargs)
get_payment_method_display()[source]
get_payment_status_display(*, field=<enumfields.fields.EnumIntegerField: payment_status>)
get_previous_by_created_on(*, field=<django.db.models.fields.DateTimeField: created_on>, is_next=False, **kwargs)
get_previous_by_modified_on(*, field=<django.db.models.fields.DateTimeField: modified_on>, is_next=False, **kwargs)
get_previous_by_order_date(*, field=<django.db.models.fields.DateTimeField: order_date>, is_next=False, **kwargs)
get_product_ids_and_quantities(supplier=None)[source]
get_product_summary(supplier=None)[source]

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

get_purchased_attachments()[source]
get_sent_shipments()[source]
get_shipping_method_display()[source]
get_shipping_status_display(*, field=<enumfields.fields.EnumIntegerField: shipping_status>)
get_status_display()[source]
get_tax_summary()[source]
Return type:taxing.TaxSummary
get_total_paid_amount()[source]
get_total_refunded_amount(supplier=None)[source]
get_total_tax_amount()[source]
get_total_unpaid_amount()[source]
get_total_unrefunded_amount(supplier=None)[source]
get_total_unrefunded_quantity(supplier=None)[source]
get_tracking_codes()[source]
get_unshipped_products(supplier=None)[source]
has_products()[source]
has_products_requiring_shipment(supplier=None)[source]
has_refunds()[source]
id

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

identifier

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

ip_address

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

is_canceled()[source]
is_complete()[source]
is_deferred()[source]
is_fully_shipped()[source]
is_not_paid()[source]
is_paid()[source]
is_partially_paid()[source]
is_partially_shipped()[source]
key

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

label

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

language

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

lines

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

In the example:

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

Parent.children is a ReverseManyToOneDescriptor instance.

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

log_entries

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

In the example:

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

Parent.children is a ReverseManyToOneDescriptor instance.

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

marketing_permission

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

modified_by

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

modified_by_id

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

modified_on

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

objects = <django.db.models.manager.ManagerFromOrderQuerySet object>
order_date

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

orderer

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

orderer_id

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

payment_data

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

payment_date

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

payment_method

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

payment_method_id

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

payment_method_name

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

payment_status

A property descriptor which ensures that field.to_python() is called on _every_ assignment to the field.

This used to be provided by the django.db.models.subclassing.Creator class, which in turn was used by the deprecated-in-Django-1.10 SubfieldBase class, hence the reimplementation here.

payments

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

In the example:

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

Parent.children is a ReverseManyToOneDescriptor instance.

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

phone

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

prices_include_tax

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

reference_number

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

require_verification

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

save(*args, **kwargs)[source]
set_canceled()[source]
shipments

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

In the example:

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

Parent.children is a ReverseManyToOneDescriptor instance.

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

shipping_address

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

shipping_address_id

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

shipping_data

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

shipping_method

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

shipping_method_id

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

shipping_method_name

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

shipping_status

A property descriptor which ensures that field.to_python() is called on _every_ assignment to the field.

This used to be provided by the django.db.models.subclassing.Creator class, which in turn was used by the deprecated-in-Django-1.10 SubfieldBase class, hence the reimplementation here.

shop

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

shop_id

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

status

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

status_id

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

tax_group

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

tax_group_id

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

tax_number

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

taxful_total_price
taxful_total_price_value

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

taxless_total_price
taxless_total_price_value

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

update_payment_status()[source]
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, created_on, modified_on, 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
  • created_on (DateTimeField) – Created on
  • modified_on (DateTimeField) – Modified on
  • order (UnsavedForeignKey to shuup.core.models.Order) – Order
  • labels (ManyToManyField to shuup.core.models.Label) – Labels
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 MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

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

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

In the example:

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

Parent.children is a ReverseManyToOneDescriptor instance.

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

extra_data

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

get_next_by_created_on(*, field=<django.db.models.fields.DateTimeField: created_on>, is_next=True, **kwargs)
get_next_by_modified_on(*, field=<django.db.models.fields.DateTimeField: modified_on>, is_next=True, **kwargs)
get_previous_by_created_on(*, field=<django.db.models.fields.DateTimeField: created_on>, is_next=False, **kwargs)
get_previous_by_modified_on(*, field=<django.db.models.fields.DateTimeField: modified_on>, is_next=False, **kwargs)
id

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

labels

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

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

log_entries

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

In the example:

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

Parent.children is a ReverseManyToOneDescriptor instance.

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

order

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

order_id

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

parent_line

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

product

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

shop
supplier

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

taxes

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

In the example:

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

Parent.children is a ReverseManyToOneDescriptor instance.

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

type

A property descriptor which ensures that field.to_python() is called on _every_ assignment to the field.

This used to be provided by the django.db.models.subclassing.Creator class, which in turn was used by the deprecated-in-Django-1.10 SubfieldBase class, hence the reimplementation here.

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 MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

add_log_entry(message, identifier=None, kind=<LogEntryKind.OTHER: 0>, user=None, extra=None, save=True)
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.

amount_value

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

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.

base_amount_value

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

id

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

log_entries

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

In the example:

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

Parent.children is a ReverseManyToOneDescriptor instance.

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

name

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

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

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

order_line_id

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

ordering

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

tax

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

tax_id

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

class shuup.core.models.OrderLineType

Bases: enumfields.enums.Enum

An enumeration.

DISCOUNT = 4
OTHER = 5
PAYMENT = 3
PRODUCT = 1
REFUND = 6
ROUNDING = 7
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 MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

extra

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

get_next_by_created_on(*, field=<django.db.models.fields.DateTimeField: created_on>, is_next=True, **kwargs)
get_previous_by_created_on(*, field=<django.db.models.fields.DateTimeField: created_on>, is_next=False, **kwargs)
id

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

kind

A property descriptor which ensures that field.to_python() is called on _every_ assignment to the field.

This used to be provided by the django.db.models.subclassing.Creator class, which in turn was used by the deprecated-in-Django-1.10 SubfieldBase class, hence the reimplementation here.

logged_model

alias of Order

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

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

target_id

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

user

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

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 and distinguish the statuses in Shuup.
  • ordering (IntegerField) – The processing order of statuses. Default is always processed first.
  • role (EnumIntegerField) – The role of this status. One role can have multiple order statuses.
  • default (BooleanField) – Defines if the status should be considered as default. Default is always processed first.
  • is_active (BooleanField) – Defines if the status is usable.
  • name (CharField) – (Translatable) Name of the order status.
  • public_name (CharField) – (Translatable) The name shown to the customers 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 MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

default

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

get_role_display(*, field=<enumfields.fields.EnumIntegerField: role>)
id

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

identifier

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

is_active

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

name

Descriptor for translated attributes.

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

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

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

In the example:

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

Parent.children is a ReverseManyToOneDescriptor instance.

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

ordering

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

public_name

Descriptor for translated attributes.

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

role

A property descriptor which ensures that field.to_python() is called on _every_ assignment to the field.

This used to be provided by the django.db.models.subclassing.Creator class, which in turn was used by the deprecated-in-Django-1.10 SubfieldBase class, hence the reimplementation here.

save(*args, **kwargs)[source]
translations

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

In the example:

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

Parent.children is a ReverseManyToOneDescriptor instance.

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

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

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

Bases: enumfields.enums.Enum

An enumeration.

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

Bases: shuup.core.models.ServiceBehaviorComponent

Parameters:
exception DoesNotExist

Bases: shuup.core.models._service_base.DoesNotExist

exception MultipleObjectsReturned

Bases: shuup.core.models._service_base.MultipleObjectsReturned

get_unavailability_reasons(service, source)[source]
help_text = "Limit service availability based on order's total price."
max_price_value

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

min_price_value

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

name = 'Order total price limit'
polymorphic_primary_key_name = 'id'
polymorphic_super_sub_accessors_replaced = False
servicebehaviorcomponent_ptr

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

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Restaurant.place is a ForwardOneToOneDescriptor instance.

servicebehaviorcomponent_ptr_id

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

class shuup.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 MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

add_log_entry(message, identifier=None, kind=<LogEntryKind.OTHER: 0>, user=None, extra=None, save=True)
currency
get_next_by_created_on(*, field=<django.db.models.fields.DateTimeField: created_on>, is_next=True, **kwargs)
get_previous_by_created_on(*, field=<django.db.models.fields.DateTimeField: created_on>, is_next=False, **kwargs)
id

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

log_entries

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

In the example:

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

Parent.children is a ReverseManyToOneDescriptor instance.

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

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

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

order_id

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

class shuup.core.models.PaymentMethod(id, identifier, enabled, shop, supplier, 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) – Enable this if this service should be selectable on checkout.
  • shop (ForeignKey to shuup.core.models.Shop) – The shop for this service.
  • supplier (ForeignKey to shuup.core.models.Supplier) – The supplier for this service. This service will be available only for order sources that contain all items from this supplier.
  • 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. Define by searching for Tax Classes.
  • payment_processor (ForeignKey to shuup.core.models.PaymentProcessor) – Payment processor
  • behavior_components (ManyToManyField to shuup.core.models.ServiceBehaviorComponent) – Behavior components
  • labels (ManyToManyField to shuup.core.models.Label) – Labels
  • name (CharField) – (Translatable) The payment method name. This name is shown to the customers on checkout.
  • description (CharField) – (Translatable) The description of the payment method. This description is shown to the 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 MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

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

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

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

can_delete()[source]
contact_set

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

In the example:

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

Parent.children is a ReverseManyToOneDescriptor instance.

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

description

Descriptor for translated attributes.

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

get_payment_process_response(order, urls)[source]
id

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

labels

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

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

line_type = 3
log_entries

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

In the example:

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

Parent.children is a ReverseManyToOneDescriptor instance.

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

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

name

Descriptor for translated attributes.

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

old_module_data

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

payment_orders

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

In the example:

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

Parent.children is a ReverseManyToOneDescriptor instance.

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

payment_processor

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

payment_processor_id

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

payment_products

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

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

process_payment_return_request(order, request)[source]
provider_attr = 'payment_processor'
shop

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

shop_product_m2m = 'payment_methods'
supplier

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

tax_class

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

translations

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

In the example:

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

Parent.children is a ReverseManyToOneDescriptor instance.

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

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) – Enable this if this service provider can be used when placing orders.
  • logo (FilerImageField to filer.models.imagemodels.Image) – Logo
  • supplier (ForeignKey to shuup.core.models.Supplier) – This service provider will be available only for order sources that contain all items from the configured supplier. If blank, this service provider is available for any order source.
  • shops (ManyToManyField to shuup.core.models.Shop) – This service provider will be available only for order sources of the given shop. If blank, this service provider is available for any order source.
  • 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

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) – Enable this if this service provider can be used when placing orders.
  • logo (FilerImageField to filer.models.imagemodels.Image) – Logo
  • supplier (ForeignKey to shuup.core.models.Supplier) – This service provider will be available only for order sources that contain all items from the configured supplier. If blank, this service provider is available for any order source.
  • shops (ManyToManyField to shuup.core.models.Shop) – This service provider will be available only for order sources of the given shop. If blank, this service provider is available for any order source.
  • 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

exception DoesNotExist

Bases: shuup.core.models._service_base.DoesNotExist

exception MultipleObjectsReturned

Bases: shuup.core.models._service_base.MultipleObjectsReturned

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

Accessor to the related object on the reverse side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Place.restaurant is a ReverseOneToOneDescriptor instance.

delete(*args, **kwargs)[source]
get_payment_process_response(service, order, urls)[source]

Get payment process response for a given order.

Return type:django.http.HttpResponse|None
log_entries

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

In the example:

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

Parent.children is a ReverseManyToOneDescriptor instance.

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

paymentmethod_set

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

In the example:

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

Parent.children is a ReverseManyToOneDescriptor instance.

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

polymorphic_primary_key_name = 'id'
polymorphic_super_sub_accessors_replaced = False
process_payment_return_request(service, order, request)[source]

Process payment return request for a given order.

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

Return type:None
service_model

alias of PaymentMethod

serviceprovider_ptr

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

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Restaurant.place is a ForwardOneToOneDescriptor instance.

serviceprovider_ptr_id

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

class shuup.core.models.PaymentStatus

Bases: enumfields.enums.Enum

An enumeration.

CANCELED = 3
DEFERRED = 4
FULLY_PAID = 2
NOT_PAID = 0
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 MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

data

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

get_next_by_time(*, field=<django.db.models.fields.DateTimeField: time>, is_next=True, **kwargs)
get_previous_by_time(*, field=<django.db.models.fields.DateTimeField: time>, is_next=False, **kwargs)
id

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

key

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

module

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

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

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

class shuup.core.models.PersonContact(id, polymorphic_ctype, created_on, modified_on, identifier, is_active, registration_shop, 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, options, picture, 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
  • modified_on (DateTimeField) – Modified on
  • identifier (InternalIdentifierField) – Do not change this value if you are not sure what you are doing.
  • is_active (BooleanField) – Enable this if the contact is an active customer.
  • registration_shop (ForeignKey to shuup.core.models.Shop) – Registration shop
  • 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) – Enable 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 contact’s orders. Tax groups are defined in Customer Tax Groups and can be applied to tax rules in 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
  • options (PolymorphicJSONField) – Options
  • picture (FilerImageField to filer.models.imagemodels.Image) – Contact picture. Can be used alongside contact profile, reviews and messages for example.
  • shops (ManyToManyField to shuup.core.models.Shop) – Inform which shops have access to this contact.
  • 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

creted_tasks

ManyToOneRel to shuup.tasks.models.Task

assigned_tasks

ManyToOneRel to shuup.tasks.models.Task

completed_tasks

ManyToOneRel to shuup.tasks.models.Task

task_comments

ManyToOneRel to shuup.tasks.models.TaskComment

contact_discounts

ManyToOneRel to shuup.discounts.models._discounts.Discount

orderer_core_baskets

ManyToOneRel to shuup.core.models.Basket

orderer_orders

ManyToOneRel to shuup.core.models.Order

order_set

ManyToOneRel to shuup.core.models.Order

contact_set

ManyToOneRel to shuup.core.models.Contact

log_entries

ManyToOneRel to shuup.core.models.PersonContactLogEntry

orderer_baskets

ManyToOneRel to shuup.front.models.stored_basket.StoredBasket

exception DoesNotExist

Bases: shuup.core.models._contacts.DoesNotExist

exception MultipleObjectsReturned

Bases: shuup.core.models._contacts.MultipleObjectsReturned

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

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

contact_ptr

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

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Restaurant.place is a ForwardOneToOneDescriptor instance.

contact_ptr_id

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

contact_set

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

In the example:

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

Parent.children is a ReverseManyToOneDescriptor instance.

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

default_contact_group_identifier = 'default_person_group'
default_contact_group_name = 'Person Contacts'
default_tax_group_getter()
first_name

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

gender

A property descriptor which ensures that field.to_python() is called on _every_ assignment to the field.

This used to be provided by the django.db.models.subclassing.Creator class, which in turn was used by the deprecated-in-Django-1.10 SubfieldBase class, hence the reimplementation here.

get_deferred_fields()[source]
get_gender_display(*, field=<enumfields.fields.EnumField: gender>)
is_all_seeing
last_name

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

log_entries

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

In the example:

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

Parent.children is a ReverseManyToOneDescriptor instance.

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

name
order_set

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

In the example:

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

Parent.children is a ReverseManyToOneDescriptor instance.

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

orderer_baskets

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

In the example:

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

Parent.children is a ReverseManyToOneDescriptor instance.

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

orderer_core_baskets

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

In the example:

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

Parent.children is a ReverseManyToOneDescriptor instance.

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

orderer_orders

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

In the example:

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

Parent.children is a ReverseManyToOneDescriptor instance.

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

polymorphic_primary_key_name = 'id'
polymorphic_super_sub_accessors_replaced = False
save(*args, **kwargs)[source]
user

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

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Restaurant.place is a ForwardOneToOneDescriptor instance.

user_id

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

class shuup.core.models.PersonContactLogEntry(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.PersonContact) – Target
exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

extra

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

get_next_by_created_on(*, field=<django.db.models.fields.DateTimeField: created_on>, is_next=True, **kwargs)
get_previous_by_created_on(*, field=<django.db.models.fields.DateTimeField: created_on>, is_next=False, **kwargs)
id

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

kind

A property descriptor which ensures that field.to_python() is called on _every_ assignment to the field.

This used to be provided by the django.db.models.subclassing.Creator class, which in turn was used by the deprecated-in-Django-1.10 SubfieldBase class, hence the reimplementation here.

logged_model

alias of PersonContact

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

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

target_id

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

user

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

class shuup.core.models.PiecesSalesUnit

Bases: shuup.core.models.SalesUnit

An 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 (e.g. ‘pieces’ or ‘units’). Sales units can be set individually 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
display_unit
name = 'Pieces'
pk
salesunit_ptr

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

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Restaurant.place is a ForwardOneToOneDescriptor instance.

salesunit_ptr_id

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

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
polymorphic_ctype

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

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
objects
polymorphic_ctype

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

polymorphic_super_sub_accessors_replaced = False
class shuup.core.models.Product(id, created_on, modified_on, deleted, kind, mode, variation_parent, 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
  • kind (IntegerField) – Kind
  • mode (EnumIntegerField) – Mode
  • variation_parent (ForeignKey to shuup.core.models.Product) – Variation parent
  • 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. To change settings search for 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. Define tax classes by searching for Tax Classes. To define the rules by which taxes are applied search for 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 products through your inventory and analyze their movement. People often use the product’s barcode number, 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 the 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 the 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 the 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 the actual product’s 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. To define these, search for 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 front.
  • 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. It also helps with getting more traffic via search engines.
  • slug (SlugField) – (Translatable) Enter a URL slug for your product. Slug is user- and search engine-friendly short text used in a URL to identify and describe a resource. In this case it will determine what your product page URL in the browser address bar will look like. 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.
  • variation_name (CharField) – (Translatable) You can enter a name for the variation of your product. This could be for example different colors, sizes or versions. To manage variations, at the top of the the individual product page, click Actions -> Manage Variations.
shipments

ManyToOneRel to shuup.core.models.ShipmentProduct

order_lines

ManyToOneRel to shuup.core.models.OrderLine

media

ManyToOneRel to shuup.core.models.ProductMedia

linked_packages_parent

ManyToOneRel to shuup.core.models.ProductPackageLink

linked_packages_child

ManyToOneRel to shuup.core.models.ProductPackageLink

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

childrenproductcondition_set

ManyToOneRel to shuup.campaigns.models.basket_conditions.ChildrenProductCondition

stock_adjustments

ManyToOneRel to shuup.simple_supplier.models.StockAdjustment

simple_supplier_stock_count

ManyToOneRel to shuup.simple_supplier.models.StockCount

product_discounts

ManyToOneRel to shuup.discounts.models._discounts.Discount

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

accounting_identifier

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

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

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

In the example:

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

Parent.children is a ReverseManyToOneDescriptor instance.

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

barcode

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

basket_set

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

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

childrenproductcondition_set

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

In the example:

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

Parent.children is a ReverseManyToOneDescriptor instance.

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

clean()[source]
clear_variation()[source]

Fully remove variation information.

Make this product a non-variation parent.

cost_center

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

created_on

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

cross_sell_1

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

In the example:

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

Parent.children is a ReverseManyToOneDescriptor instance.

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

cross_sell_2

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

In the example:

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

Parent.children is a ReverseManyToOneDescriptor instance.

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

delete(using=None)[source]
deleted

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

depth

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

description

Descriptor for translated attributes.

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

discountfromproduct_set

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

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

freeproductline_set

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

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

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, would explode to 15,625 combinations.)

Returns:Iterable of combination information dicts.
Return type:Iterable[dict]
get_all_package_children()[source]
get_all_package_parents()[source]
get_available_attribute_queryset()[source]
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]
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
get_cheapest_child_price(context, quantity=1)[source]
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
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)
get_kind_display(*, field=<django.db.models.fields.IntegerField: kind>)
get_mode_display(*, field=<enumfields.fields.EnumIntegerField: mode>)
get_next_by_created_on(*, field=<django.db.models.fields.DateTimeField: created_on>, is_next=True, **kwargs)
get_next_by_modified_on(*, field=<django.db.models.fields.DateTimeField: modified_on>, is_next=True, **kwargs)
get_package_child_to_quantity_map()[source]
get_previous_by_created_on(*, field=<django.db.models.fields.DateTimeField: created_on>, is_next=False, **kwargs)
get_previous_by_modified_on(*, field=<django.db.models.fields.DateTimeField: modified_on>, is_next=False, **kwargs)
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
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
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.
get_public_media()[source]
get_shipping_mode_display(*, field=<enumfields.fields.EnumIntegerField: shipping_mode>)
get_shop_instance(shop, allow_cache=False)[source]
Return type:shuup.core.models.ShopProduct
get_variation_siblings()[source]
gross_weight

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

gtin

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

height

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

id

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

is_container()[source]
is_package_child()[source]
is_package_parent()[source]
is_subscription_parent()[source]
is_variation_child()[source]
is_variation_parent()[source]
keywords

Descriptor for translated attributes.

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

kind

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

Parameters:
  • parent (Product) – The parent to link to.
  • variables (dict|None) – Optional dict of {variable identifier: value identifier} for a complex variable linkage.
  • combination_hash (str|None) – Optional combination hash (for variable variations), if precomputed. Mutually exclusive with variables.
linked_packages_child

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

In the example:

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

Parent.children is a ReverseManyToOneDescriptor instance.

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

linked_packages_parent

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

In the example:

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

Parent.children is a ReverseManyToOneDescriptor instance.

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

log_entries

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

In the example:

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

Parent.children is a ReverseManyToOneDescriptor instance.

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

make_package(package_def)[source]
manufacturer

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

manufacturer_id

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

media

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

In the example:

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

Parent.children is a ReverseManyToOneDescriptor instance.

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

mode

A property descriptor which ensures that field.to_python() is called on _every_ assignment to the field.

This used to be provided by the django.db.models.subclassing.Creator class, which in turn was used by the deprecated-in-Django-1.10 SubfieldBase class, hence the reimplementation here.

modified_on

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

name

Descriptor for translated attributes.

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

net_weight

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

objects = <django.db.models.manager.ManagerFromProductQuerySet object>
order_lines

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

In the example:

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

Parent.children is a ReverseManyToOneDescriptor instance.

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

primary_image

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

primary_image_id

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

product_discounts

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

In the example:

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

Parent.children is a ReverseManyToOneDescriptor instance.

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

productfilter_set

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

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

productsinbasketcondition_set

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

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

profit_center

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

sales_unit

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

sales_unit_id

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

save(*args, **kwargs)[source]
shipments

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

In the example:

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

Parent.children is a ReverseManyToOneDescriptor instance.

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

shipping_mode

A property descriptor which ensures that field.to_python() is called on _every_ assignment to the field.

This used to be provided by the django.db.models.subclassing.Creator class, which in turn was used by the deprecated-in-Django-1.10 SubfieldBase class, hence the reimplementation here.

shop_products

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

In the example:

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

Parent.children is a ReverseManyToOneDescriptor instance.

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

short_description

Descriptor for translated attributes.

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

simple_supplier_stock_count

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

In the example:

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

Parent.children is a ReverseManyToOneDescriptor instance.

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

simplify_variation()[source]

Remove variation variables from a 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, that shouldn’t be variable any more.
sku

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

slug

Descriptor for translated attributes.

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

soft_delete(user=None)[source]
stock_adjustments

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

In the example:

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

Parent.children is a ReverseManyToOneDescriptor instance.

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

storedbasket_set

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

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

suppliedproduct_set

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

In the example:

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

Parent.children is a ReverseManyToOneDescriptor instance.

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

tax_class

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

tax_class_id

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

translations

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

In the example:

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

Parent.children is a ReverseManyToOneDescriptor instance.

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

type

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

type_id

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

variation_children

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

In the example:

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

Parent.children is a ReverseManyToOneDescriptor instance.

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

variation_name

Descriptor for translated attributes.

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

variation_parent

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

variation_parent_id

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

variation_result_subs

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

In the example:

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

Parent.children is a ReverseManyToOneDescriptor instance.

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

variation_result_supers

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

In the example:

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

Parent.children is a ReverseManyToOneDescriptor instance.

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

variation_variables

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

In the example:

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

Parent.children is a ReverseManyToOneDescriptor instance.

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

verify_mode()[source]
width

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

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
  • chosen_options (ManyToManyField to shuup.core.models.AttributeChoiceOption) – Chosen options
  • translated_string_value (TextField) – (Translatable) Translated value
translations

ManyToOneRel to shuup.core.models._products.ProductAttributeTranslation

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

attribute

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

chosen_options

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

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

id

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

product

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

product_id

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

translated_string_value

Descriptor for translated attributes.

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

translations

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

In the example:

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

Parent.children is a ReverseManyToOneDescriptor instance.

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

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 MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

get_type_display(*, field=<enumfields.fields.EnumIntegerField: type>)
id

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

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

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

product1_id

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

product2

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

product2_id

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

type

A property descriptor which ensures that field.to_python() is called on _every_ assignment to the field.

This used to be provided by the django.db.models.subclassing.Creator class, which in turn was used by the deprecated-in-Django-1.10 SubfieldBase class, hence the reimplementation here.

weight

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

class shuup.core.models.ProductCrossSellType

Bases: enumfields.enums.Enum

An enumeration.

BOUGHT_WITH = 4
COMPUTED = 3
RECOMMENDED = 1
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 can assign numerical values to images to tell the order in which they shall be displayed on the product page.
  • enabled (BooleanField) – Enabled
  • public (BooleanField) – Enable this if you want this image be shown on the product page. Enabled by default.
  • purchased (BooleanField) – Enable this if you want the product media to be 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 MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

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

Descriptor for translated attributes.

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

easy_thumbnails_thumbnailer

Get Thumbnailer instance.

Will return None if file cannot be thumbnailed.

:rtype:easy_thumbnails.files.Thumbnailer|None

effective_title
enabled

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

external_url

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

file

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

file_id

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

get_kind_display(*, field=<enumfields.fields.EnumIntegerField: kind>)
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
id

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

identifier

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

kind

A property descriptor which ensures that field.to_python() is called on _every_ assignment to the field.

This used to be provided by the django.db.models.subclassing.Creator class, which in turn was used by the deprecated-in-Django-1.10 SubfieldBase class, hence the reimplementation here.

log_entries

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

In the example:

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

Parent.children is a ReverseManyToOneDescriptor instance.

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

ordering

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

primary_image_for_products

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

In the example:

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

Parent.children is a ReverseManyToOneDescriptor instance.

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

primary_image_for_shop_products

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

In the example:

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

Parent.children is a ReverseManyToOneDescriptor instance.

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

product

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

product_id

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

public

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

purchased

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

shops

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

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

title

Descriptor for translated attributes.

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

translations

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

In the example:

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

Parent.children is a ReverseManyToOneDescriptor instance.

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

url
class shuup.core.models.ProductMediaKind

Bases: enumfields.enums.Enum

An enumeration.

DOCUMENTATION = 3
GENERIC_FILE = 1
IMAGE = 2
SAMPLE = 4
class shuup.core.models.ProductMode

Bases: enumfields.enums.Enum

An enumeration.

NORMAL = 0
PACKAGE_PARENT = 1
SIMPLE_VARIATION_PARENT = 2
SUBSCRIPTION = 5
VARIABLE_VARIATION_PARENT = 3
VARIATION_CHILD = 4

Bases: django.db.models.base.Model

Parameters:
exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

child

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

child_id

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

id

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

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

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

parent_id

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

quantity

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

class 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. To change available attributes search for 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 MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

attributes

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

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

id

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

identifier

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

name

Descriptor for translated attributes.

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

products

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

In the example:

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

Parent.children is a ReverseManyToOneDescriptor instance.

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

producttypefilter_set

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

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

translations

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

In the example:

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

Parent.children is a ReverseManyToOneDescriptor instance.

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

class shuup.core.models.ProductVariationLinkStatus

Bases: enumfields.enums.Enum

An enumeration.

INVISIBLE = 0
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 MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

combination_hash

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

get_status_display(*, field=<enumfields.fields.EnumIntegerField: status>)
id

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

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

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

product_id

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

classmethod resolve(parent_product, combination)[source]
result

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

result_id

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

status

A property descriptor which ensures that field.to_python() is called on _every_ assignment to the field.

This used to be provided by the django.db.models.subclassing.Creator class, which in turn was used by the deprecated-in-Django-1.10 SubfieldBase class, hence the reimplementation here.

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 MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

identifier

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name

Descriptor for translated attributes.

This attribute proxies all get/set calls to the translated model.

product

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

product_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

translations

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

values

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

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 MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

identifier

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

translations

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

value

Descriptor for translated attributes.

This attribute proxies all get/set calls to the translated model.

variable

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

variable_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class shuup.core.models.ProductVisibility

Bases: enumfields.enums.Enum

An enumeration.

VISIBLE_TO_ALL = 1
VISIBLE_TO_GROUPS = 3
VISIBLE_TO_LOGGED_IN = 2
class shuup.core.models.RoundingMode

Bases: enumfields.enums.Enum

An enumeration.

ROUND_DOWN = 'ROUND_DOWN'
ROUND_HALF_DOWN = 'ROUND_HALF_DOWN'
ROUND_HALF_UP = 'ROUND_HALF_UP'
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 (e.g. ‘pieces’ or ‘units’). Sales units can be set individually 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 MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

allow_fractions
decimals

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

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
display_units

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

identifier

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name

Descriptor for translated attributes.

This attribute proxies all get/set calls to the translated model.

product_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

quantity_step

Get the quantity increment for the amount of decimals this unit allows.

For zero decimals, this will be 1; for one decimal, 0.1; etc.

Returns:Decimal in (0..1].
Return type:Decimal
round(value)[source]
symbol

Descriptor for translated attributes.

This attribute proxies all get/set calls to the translated model.

translations

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

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 MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

add_log_entry(message, identifier=None, kind=<LogEntryKind.OTHER: 0>, user=None, extra=None, save=True)
address

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

address_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

get_role_display(*, field=<enumfields.fields.EnumIntegerField: role>)
get_status_display(*, field=<enumfields.fields.EnumIntegerField: status>)
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.

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

log_entries

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

objects = <shuup.core.models._addresses.SavedAddressManager object>
owner

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

owner_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

role

A property descriptor which ensures that field.to_python() is called on _every_ assignment to the field.

This used to be provided by the django.db.models.subclassing.Creator class, which in turn was used by the deprecated-in-Django-1.10 SubfieldBase class, hence the reimplementation here.

status

A property descriptor which ensures that field.to_python() is called on _every_ assignment to the field.

This used to be provided by the django.db.models.subclassing.Creator class, which in turn was used by the deprecated-in-Django-1.10 SubfieldBase class, hence the reimplementation here.

title

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class shuup.core.models.SavedAddressRole

Bases: enumfields.enums.Enum

An enumeration.

BILLING = 2
SHIPPING = 1
class shuup.core.models.SavedAddressStatus

Bases: enumfields.enums.Enum

An enumeration.

DISABLED = 0
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) – Enable this if this service should be selectable on checkout.
  • shop (ForeignKey to shuup.core.models.Shop) – The shop for this service.
  • supplier (ForeignKey to shuup.core.models.Supplier) – The supplier for this service. This service will be available only for order sources that contain all items from this supplier.
  • 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. Define by searching for Tax Classes.
  • behavior_components (ManyToManyField to shuup.core.models.ServiceBehaviorComponent) – Behavior components
  • labels (ManyToManyField to shuup.core.models.Label) – Labels
class Meta[source]

Bases: object

abstract = False
behavior_components

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

choice_identifier

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

description

Descriptor for translated attributes.

This attribute proxies all get/set calls to the translated model.

enabled

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

get_costs(source)[source]

Get costs of this service for items in a given source.

Returns:description, price and tax class of the costs.
Return type:Iterable[ServiceCost]
get_effective_name(source)[source]

Get an effective name of the service for a 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
get_lines(source)[source]

Get lines for a given source.

Lines are created based on costs. Costs without descriptions are combined to a single line.

Return type:Iterable[shuup.core.order_creator.SourceLine]
get_total_cost(source)[source]

Get total cost of this service for items in a given source.

Return type:PriceInfo
get_unavailability_reasons(source)[source]

Get reasons of being unavailable for a given source.

Return type:Iterable[ValidationError]
identifier

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

is_available_for(source)[source]

Return true if service is available for a given source.

Return type:bool
labels

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

logo_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name

Descriptor for translated attributes.

This attribute proxies all get/set calls to the translated model.

objects
old_module_data

A placeholder class that provides a way to set the attribute on the model.

old_module_identifier

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

provider
Return type:shuup.core.models.ServiceProvider
shop

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

shop_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

supplier

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

supplier_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

tax_class

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

tax_class_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class shuup.core.models.ServiceBehaviorComponent(id, polymorphic_ctype, identifier)

Bases: shuup.core.models.PolymorphicShuupModel

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.
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

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

countrylimitbehaviorcomponent

Accessor to the related object on the reverse side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Place.restaurant is a ReverseOneToOneDescriptor instance.

fixedcostbehaviorcomponent

Accessor to the related object on the reverse side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Place.restaurant is a ReverseOneToOneDescriptor instance.

get_costs(service, source)[source]

Return costs for this object. This should be implemented in a subclass. This method is used to calculate price for ShippingMethod and PaymentMethod objects.

Return type:Iterable[ServiceCost]
get_delivery_time(service, source)[source]
Return type:shuup.utils.dates.DurationRange|None
get_unavailability_reasons(service, source)[source]
Return type:Iterable[ValidationError]
groupavailabilitybehaviorcomponent

Accessor to the related object on the reverse side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Place.restaurant is a ReverseOneToOneDescriptor instance.

help_text = None
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

identifier

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name = None
ordertotallimitbehaviorcomponent

Accessor to the related object on the reverse side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Place.restaurant is a ReverseOneToOneDescriptor instance.

paymentmethod_set

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

polymorphic_ctype

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

polymorphic_primary_key_name = 'id'
polymorphic_super_sub_accessors_replaced = False
shippingmethod_set

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

staffonlybehaviorcomponent

Accessor to the related object on the reverse side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Place.restaurant is a ReverseOneToOneDescriptor instance.

waivingcostbehaviorcomponent

Accessor to the related object on the reverse side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Place.restaurant is a ReverseOneToOneDescriptor instance.

weightbasedpricingbehaviorcomponent

Accessor to the related object on the reverse side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Place.restaurant is a ReverseOneToOneDescriptor instance.

weightlimitsbehaviorcomponent

Accessor to the related object on the reverse side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Place.restaurant is a ReverseOneToOneDescriptor instance.

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, description must also 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 a 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) – Enable this if this service provider can be used when placing orders.
  • logo (FilerImageField to filer.models.imagemodels.Image) – Logo
  • supplier (ForeignKey to shuup.core.models.Supplier) – This service provider will be available only for order sources that contain all items from the configured supplier. If blank, this service provider is available for any order source.
  • shops (ManyToManyField to shuup.core.models.Shop) – This service provider will be available only for order sources of the given shop. If blank, this service provider is available for any order source.
  • 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) – Enable this if this service provider can be used when placing orders.
  • logo (FilerImageField to filer.models.imagemodels.Image) – Logo
  • supplier (ForeignKey to shuup.core.models.Supplier) – This service provider will be available only for order sources that contain all items from the configured supplier. If blank, this service provider is available for any order source.
  • shops (ManyToManyField to shuup.core.models.Shop) – This service provider will be available only for order sources of the given shop. If blank, this service provider is available for any order source.
  • 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 MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

base_translations

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

carrier

Accessor to the related object on the reverse side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Place.restaurant is a ReverseOneToOneDescriptor instance.

create_service(choice_identifier, **kwargs)[source]

Create a service for a given choice identifier.

Subclass implementation may attach some behavior components to the created service.

Subclasses should provide implementation for _create_service or override it. 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
enabled

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

get_effective_name(service, source)[source]

Get effective name of the service for a 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
get_service_choices()[source]

Get all service choices of this provider.

Subclasses should implement this method.

Return type:list[ServiceChoice]
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

identifier

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

logo_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name

Descriptor for translated attributes.

This attribute proxies all get/set calls to the translated model.

paymentprocessor

Accessor to the related object on the reverse side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Place.restaurant is a ReverseOneToOneDescriptor instance.

polymorphic_ctype

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

polymorphic_primary_key_name = 'id'
polymorphic_super_sub_accessors_replaced = False
service_model = None
shops

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

supplier

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

supplier_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class shuup.core.models.Shipment(id, order, supplier, created_on, status, tracking_code, tracking_url, 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
  • tracking_url (URLField) – Tracking url
  • description (CharField) – Description
  • volume (MeasurementField) – Volume (mm3)
  • weight (MeasurementField) – Weight (g)
  • 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 MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

add_log_entry(message, identifier=None, kind=<LogEntryKind.OTHER: 0>, user=None, extra=None, save=True)
cache_values()[source]

(Re)cache volume and weight for this Shipment from within the ShipmentProducts.

created_on

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

delete(using=None)[source]
description

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

get_next_by_created_on(*, field=<django.db.models.fields.DateTimeField: created_on>, is_next=True, **kwargs)
get_previous_by_created_on(*, field=<django.db.models.fields.DateTimeField: created_on>, is_next=False, **kwargs)
get_status_display(*, field=<enumfields.fields.EnumIntegerField: status>)
get_type_display(*, field=<enumfields.fields.EnumIntegerField: type>)
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

identifier

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

is_deleted()[source]
is_sent()[source]
log_entries

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

objects = <django.db.models.manager.ManagerFromShipmentQueryset object>
order

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

order_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

products

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

save(*args, **kwargs)[source]
set_received(purchase_prices=None, created_by=None)[source]

Mark the shipment as 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
set_sent()[source]

Mark the shipment as sent.

soft_delete(user=None)[source]
status

A property descriptor which ensures that field.to_python() is called on _every_ assignment to the field.

This used to be provided by the django.db.models.subclassing.Creator class, which in turn was used by the deprecated-in-Django-1.10 SubfieldBase class, hence the reimplementation here.

supplier

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

supplier_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

total_products
tracking_code

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

tracking_url

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

type

A property descriptor which ensures that field.to_python() is called on _every_ assignment to the field.

This used to be provided by the django.db.models.subclassing.Creator class, which in turn was used by the deprecated-in-Django-1.10 SubfieldBase class, hence the reimplementation here.

volume

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

weight

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

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 MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

add_log_entry(message, identifier=None, kind=<LogEntryKind.OTHER: 0>, user=None, extra=None, save=True)
cache_values()[source]
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

log_entries

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

objects = <django.db.models.manager.Manager object>
product

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

product_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

quantity

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

shipment

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

shipment_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

unit_volume

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

unit_weight

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class shuup.core.models.ShipmentStatus

Bases: enumfields.enums.Enum

An enumeration.

DELETED = 20
ERROR = 10
NOT_SENT = 0
RECEIVED = 2
SENT = 1
class shuup.core.models.ShipmentType

Bases: enumfields.enums.Enum

An enumeration.

IN = 1
OUT = 0
class shuup.core.models.ShippingMethod(id, identifier, enabled, shop, supplier, 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) – Enable this if this service should be selectable on checkout.
  • shop (ForeignKey to shuup.core.models.Shop) – The shop for this service.
  • supplier (ForeignKey to shuup.core.models.Supplier) – The supplier for this service. This service will be available only for order sources that contain all items from this supplier.
  • 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. Define by searching for Tax Classes.
  • carrier (ForeignKey to shuup.core.models.Carrier) – Carrier
  • behavior_components (ManyToManyField to shuup.core.models.ServiceBehaviorComponent) – Behavior components
  • labels (ManyToManyField to shuup.core.models.Label) – Labels
  • name (CharField) – (Translatable) The shipping method name. This name is shown to the 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 MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

add_log_entry(message, identifier=None, kind=<LogEntryKind.OTHER: 0>, user=None, extra=None, save=True)
behavior_components

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

can_delete()[source]
carrier

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

carrier_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

contact_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

description

Descriptor for translated attributes.

This attribute proxies all get/set calls to the translated model.

get_shipping_time(source)[source]

Get shipping time for items in given source.

Return type:shuup.utils.dates.DurationRange|None
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

labels

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

line_type = 2
log_entries

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

name

Descriptor for translated attributes.

This attribute proxies all get/set calls to the translated model.

old_module_data

A placeholder class that provides a way to set the attribute on the model.

provider_attr = 'carrier'
shipping_orders

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

shipping_products

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

shop

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

shop_product_m2m = 'shipping_methods'
supplier

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

tax_class

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

translations

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

class shuup.core.models.ShippingMode

Bases: enumfields.enums.Enum

An enumeration.

NOT_SHIPPED = 0
SHIPPED = 1
class shuup.core.models.ShippingStatus

Bases: enumfields.enums.Enum

An enumeration.

FULLY_SHIPPED = 2
NOT_SHIPPED = 0
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
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 store front. Note: this requires additional configuration through your internet domain registrar.
  • status (EnumIntegerField) – Your shop’s status. Disable your shop if it’s no longer in use. For temporary closing enable the maintenance mode, available in the Maintenance Mode tab on the left.
  • owner (ForeignKey to shuup.core.models.Contact) – Contact
  • options (JSONField) – Options
  • currency (CurrencyField) – The primary shop currency. This is the currency used when selling the 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’s logo. Will be shown at theme.
  • favicon (FilerImageField to filer.models.imagemodels.Image) – Shop’s favicon - a mini-image graphically representing your shop. Depending on the browser, it will be shown next to the address bar and/or on the website title tab.
  • maintenance_mode (BooleanField) – Enable if you want to make your shop temporarily unavailable to visitors while you do regular shop maintenance, fight the security breach or for some other reason. If you don’t plan to have this shop open again, change the Status on the main General Information tab to Disabled.
  • contact_address (ForeignKey to shuup.core.models.MutableAddress) – Contact address
  • staff_members (ManyToManyField to django.contrib.auth.models.User) – Staff members
  • labels (ManyToManyField to shuup.core.models.Label) – Labels
  • name (CharField) – (Translatable) The shop name. This name is displayed throughout Admin Panel.
  • public_name (CharField) – (Translatable) The public shop name. This name is displayed in the store front and in any customer email correspondence.
  • description (TextField) – (Translatable) To make your shop stand out, give it an awesome description. This is what will help your shoppers learn about your shop. It will also help shoppers find your store from the web.
  • short_description (CharField) – (Translatable) Enter a short description for your shop. The short description will be used to get the attention of your customer with a small, but precise description of your shop. It also helps with getting more traffic via search engines.
  • maintenance_message (CharField) – (Translatable) The message to display to customers while your shop is in a maintenance mode.
background_tasks

ManyToOneRel to shuup.core.models.BackgroundTask

basket_set

ManyToOneRel to shuup.core.models.Basket

supplier_shops

ManyToOneRel to shuup.core.models.SupplierShop

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

price_display_options

ManyToOneRel to shuup.core.models.ContactGroupPriceDisplay

contact_groups

ManyToOneRel to shuup.core.models.ContactGroup

registrations

ManyToOneRel to shuup.core.models.Contact

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

notification_set

ManyToOneRel to shuup.notify.models.notification.Notification

script_set

ManyToOneRel to shuup.notify.models.script.Script

page_set

ManyToOneRel to shuup.simple_cms.models.Page

cgpprice_set

ManyToOneRel to shuup.customer_group_pricing.models.CgpPrice

cgpdiscount_set

ManyToOneRel to shuup.customer_group_pricing.models.CgpDiscount

catalogcampaign_set

ManyToOneRel to shuup.campaigns.models.campaigns.CatalogCampaign

basketcampaign_set

ManyToOneRel to shuup.campaigns.models.campaigns.BasketCampaign

campaign_coupons

ManyToOneRel to shuup.campaigns.models.campaigns.Coupon

saved_views_config

ManyToOneRel to shuup.xtheme.models.SavedViewConfig

themes_settings

ManyToOneRel to shuup.xtheme.models.ThemeSettings

snippets

ManyToOneRel to shuup.xtheme.models.Snippet

gdpr_settings

OneToOneRel to shuup.gdpr.models.GDPRSettings

ManyToOneRel to shuup.gdpr.models.GDPRCookieCategory

gdpr_consents

ManyToOneRel to shuup.gdpr.models.GDPRUserConsent

task_types

ManyToOneRel to shuup.tasks.models.TaskType

tasks

ManyToOneRel to shuup.tasks.models.Task

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

add_log_entry(message, identifier=None, kind=<LogEntryKind.OTHER: 0>, user=None, extra=None, save=True)
availabilityexception_set

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

background_tasks

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

basket_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

basketcampaign_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

campaign_coupons

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

carousels

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

catalogcampaign_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

categories

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

cgpdiscount_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

cgpprice_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

change_protect_message = "The following fields can't be changed because there are existing orders for this shop."
contact_address

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

contact_address_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

contact_groups

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

contact_set

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

couponcode_set

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

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
created_on

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

currency

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

description

Descriptor for translated attributes.

This attribute proxies all get/set calls to the translated model.

discount_set

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

domain

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

favicon

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

favicon_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

gdpr_consents

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

gdpr_cookie_categories

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

gdpr_settings

Accessor to the related object on the reverse side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Place.restaurant is a ReverseOneToOneDescriptor instance.

get_next_by_created_on(*, field=<django.db.models.fields.DateTimeField: created_on>, is_next=True, **kwargs)
get_next_by_modified_on(*, field=<django.db.models.fields.DateTimeField: modified_on>, is_next=True, **kwargs)
get_previous_by_created_on(*, field=<django.db.models.fields.DateTimeField: created_on>, is_next=False, **kwargs)
get_previous_by_modified_on(*, field=<django.db.models.fields.DateTimeField: modified_on>, is_next=False, **kwargs)
get_status_display(*, field=<enumfields.fields.EnumIntegerField: status>)
happyhour_set

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

identifier

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

labels

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

log_entries

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

logo_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

maintenance_message

Descriptor for translated attributes.

This attribute proxies all get/set calls to the translated model.

maintenance_mode

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

manufacturer_set

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

media_files

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

media_folders

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

modified_on

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name

Descriptor for translated attributes.

This attribute proxies all get/set calls to the translated model.

notification_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

objects = <shuup.core.models._shops.ShopManager object>
options

A placeholder class that provides a way to set the attribute on the model.

order_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

owner

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

owner_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

page_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

paymentmethod_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

price_display_options

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

prices_include_tax

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

product_media

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

protected_fields = ['currency', 'prices_include_tax']
public_name

Descriptor for translated attributes.

This attribute proxies all get/set calls to the translated model.

registrations

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

saved_views_config

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

script_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

service_providers

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

shippingmethod_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

shop_products

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

short_description

Descriptor for translated attributes.

This attribute proxies all get/set calls to the translated model.

snippets

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

staff_members

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

status

A property descriptor which ensures that field.to_python() is called on _every_ assignment to the field.

This used to be provided by the django.db.models.subclassing.Creator class, which in turn was used by the deprecated-in-Django-1.10 SubfieldBase class, hence the reimplementation here.

storedbasket_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

supplier_shops

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

suppliers

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

task_types

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

tasks

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

themes_settings

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

translations

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

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, available_until, 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) – Choose how you want your product to be seen and found by the customers. Not visible: Product will not be shown in your store front nor 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 already sold out (out of stock). Set to blank for product to be purchasable without limits.
  • purchase_multiple (QuantityField) – Set this to other than 0 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. Not to be confused with the Minimum Purchase Quantity.
  • 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) – Enable this if you want to limit your product to use only the select shipping methods. You can select the allowed shipping method(s) in the field below - all the rest are disallowed.
  • limit_payment_methods (BooleanField) – Enable this if you want to limit your product to use only the select payment methods. You can select the allowed payment method(s) in the field below - all the rest are disallowed.
  • primary_category (ForeignKey to shuup.core.models.Category) – Choose the primary category for the product. This will be the main category for classification in the system. The product will be found under this category in your store. To change this, search for Categories.
  • shop_primary_image (ForeignKey to shuup.core.models.ProductMedia) – Click this to set this image as the primary display image for the 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 calculated 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 the cost.
  • available_until (DateTimeField) – After this date this product will be invisible in store front.
  • 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 by searching for Suppliers.
  • visibility_groups (ManyToManyField to shuup.core.models.ContactGroup) – Select the groups you want to make your product visible for. These groups are defined in Contacts Settings - Contact Groups.
  • shipping_methods (ManyToManyField to shuup.core.models.ShippingMethod) – If you enabled the Limit the payment methods choice above, then here you can select the individual shipping methods you want to ALLOW for this product. The ones not mentioned are disabled. To change this, search for Shipping Methods.
  • payment_methods (ManyToManyField to shuup.core.models.PaymentMethod) – If you enabled the Limit the payment methods choice above, then here you can select the individuals payment methods you want to ALLOW for this product. The ones not mentioned are disabled. To change this, search for 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 front.
  • description (TextField) – (Translatable) To make your product stands 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. It also helps with getting more traffic via search engines.
  • 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)
translations

ManyToOneRel to shuup.core.models._product_shops.ShopProductTranslation

log_entries

ManyToOneRel to shuup.core.models._product_shops.ShopProductLogEntry

cached_catalog_campaign_filters

ManyToOneRel to shuup.campaigns.models.cache.CatalogFilterCachedShopProduct

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

add_log_entry(message, identifier=None, kind=<LogEntryKind.OTHER: 0>, user=None, extra=None, save=True)
available_until

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

backorder_maximum

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

cached_catalog_campaign_filters

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

categories

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

clean()[source]
default_price

Property for Price object.

Similar to MoneyProperty, but also has includes_tax field.

Operaters with TaxfulPrice and TaxlessPrice objects.

default_price_value

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

description

Descriptor for translated attributes.

This attribute proxies all get/set calls to the translated model.

display_quantity_minimum

Quantity minimum of this shop product in the display unit.

Note: This can never be smaller than the display precision.

display_quantity_step

Quantity step of this shop product in the display unit.

Note: This can never be smaller than the display precision.

display_unit

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

display_unit_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

get_description()[source]
get_name()[source]
get_orderability_errors(supplier, quantity, customer, ignore_minimum=False)[source]

Yield ValidationErrors that would cause this product to not be orderable.

Shop product to be orderable it needs to be visible visible and purchasable.

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]

get_orderability_errors_for_package_parent(supplier, customer, quantity, ignore_minimum)[source]
get_orderability_errors_for_simple_variation_parent(supplier, customer)[source]
get_orderability_errors_for_variable_variation_parent(supplier, customer)[source]
get_purchasability_errors(supplier, customer, quantity, ignore_minimum=False)[source]

Yield ValidationErrors that would cause this product to not be purchasable.

Shop product to be purchasable it has to have purchasable attribute set on and pass all quantity and supplier checks.

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]

get_quantity_errors(quantity, ignore_minimum)[source]
get_short_description()[source]
get_supplier(customer=None, quantity=None, shipping_address=None)[source]
get_supplier_errors(supplier, customer, quantity, ignore_minimum)[source]
get_visibility_display(*, field=<enumfields.fields.EnumIntegerField: visibility>)
get_visibility_errors(customer)[source]
get_visibility_limit_display(*, field=<enumfields.fields.EnumIntegerField: visibility_limit>)
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

images
is_list_visible()[source]

Return True if this product should be visible in listings in general, without taking into account any other visibility limitations.

Return type:bool
is_orderable(supplier, customer, quantity, allow_cache=True)[source]

Product to be orderable it needs to be visible and purchasable.

is_purchasable(supplier, customer, quantity)[source]

Whether product can be purchased.

is_visible(customer)[source]

Visible products are shown in store front based on customer or customer group limitations.

limit_payment_methods

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

limit_shipping_methods

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

listed
log_entries

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

minimum_price

Property for Price object.

Similar to MoneyProperty, but also has includes_tax field.

Operaters with TaxfulPrice and TaxlessPrice objects.

minimum_price_value

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

minimum_purchase_quantity

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name

Descriptor for translated attributes.

This attribute proxies all get/set calls to the translated model.

payment_methods

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

primary_category

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

primary_category_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

primary_image
product

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

product_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

public_images
public_primary_image
purchasable

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

purchase_multiple

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

quantity_step

Quantity step for purchasing this product.

Return type:decimal.Decimal
Example:
<input type=”number” step=”{{ shop_product.quantity_step }}”>
raise_if_not_orderable(supplier, customer, quantity, ignore_minimum=False)[source]
raise_if_not_visible(customer)[source]
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 }}”>
save(*args, **kwargs)[source]
searchable
shipping_methods

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

shop

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

shop_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

shop_primary_image

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

shop_primary_image_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

short_description

Descriptor for translated attributes.

This attribute proxies all get/set calls to the translated model.

status_text

Descriptor for translated attributes.

This attribute proxies all get/set calls to the translated model.

suppliers

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

translations

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

unit

Unit of this product.

Return type:shuup.core.models.UnitInterface
visibility

A property descriptor which ensures that field.to_python() is called on _every_ assignment to the field.

This used to be provided by the django.db.models.subclassing.Creator class, which in turn was used by the deprecated-in-Django-1.10 SubfieldBase class, hence the reimplementation here.

visibility_groups

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

visibility_limit

A property descriptor which ensures that field.to_python() is called on _every_ assignment to the field.

This used to be provided by the django.db.models.subclassing.Creator class, which in turn was used by the deprecated-in-Django-1.10 SubfieldBase class, hence the reimplementation here.

visible
class shuup.core.models.ShopProductVisibility

Bases: enumfields.enums.Enum

An enumeration.

ALWAYS_VISIBLE = 3
LISTED = 2
NOT_VISIBLE = 0
SEARCHABLE = 1
class shuup.core.models.ShopStatus

Bases: enumfields.enums.Enum

An enumeration.

DISABLED = 0
ENABLED = 1
class shuup.core.models.StaffOnlyBehaviorComponent(id, polymorphic_ctype, identifier, servicebehaviorcomponent_ptr)

Bases: shuup.core.models.ServiceBehaviorComponent

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.
  • servicebehaviorcomponent_ptr (OneToOneField to shuup.core.models.ServiceBehaviorComponent) – Servicebehaviorcomponent ptr
exception DoesNotExist

Bases: shuup.core.models._service_base.DoesNotExist

exception MultipleObjectsReturned

Bases: shuup.core.models._service_base.MultipleObjectsReturned

get_unavailability_reasons(service, source)[source]
help_text = 'Make service available only for people with `Access to Admin Panel` rights.'
name = 'Access to Admin Panel only availability'
polymorphic_primary_key_name = 'id'
polymorphic_super_sub_accessors_replaced = False
servicebehaviorcomponent_ptr

Accessor to the related object on the forward side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Restaurant.place is a ForwardOneToOneDescriptor instance.

servicebehaviorcomponent_ptr_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class shuup.core.models.StockBehavior

Bases: enumfields.enums.Enum

An enumeration.

STOCKED = 1
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 MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

add_log_entry(message, identifier=None, kind=<LogEntryKind.OTHER: 0>, user=None, extra=None, save=True)
alert_limit

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

log_entries

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

logical_count

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <django.db.models.manager.Manager object>
physical_count

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

product

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

product_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

sku

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

supplier

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

supplier_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class shuup.core.models.Supplier(id, created_on, modified_on, identifier, name, type, stock_managed, module_data, enabled, logo, contact_address, options, slug, deleted)

Bases: shuup.core.modules.interface.ModuleInterface, 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.
  • name (CharField) – The product supplier’s name. You can enable suppliers to 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, and which group this supplier belongs to.
  • stock_managed (BooleanField) – Enable this if this supplier will manage the inventory of the stocked products. Having a managed stock enabled is unnecessary if e.g. selling digital products that will never run out no matter how many are being sold. There are some other cases when it could be an unnecessary complication. This settingmerely assigns a sensible default behavior, which can be overwritten on a product-by-product basis.
  • module_data (JSONField) – Module data
  • enabled (BooleanField) – Indicates whether this supplier is currently enabled. In order to participate fully, the supplier also needs to be Approved.
  • logo (FilerImageField to filer.models.imagemodels.Image) – Logo
  • contact_address (ForeignKey to shuup.core.models.MutableAddress) – Contact address
  • options (JSONField) – Options
  • slug (SlugField) – Enter a URL slug for your supplier. Slug is user- and search engine-friendly short text used in a URL to identify and describe a resource. In this case it will determine what your supplier page URL in the browser address bar will look like. A default will be created using the supplier name.
  • deleted (BooleanField) – Deleted
  • supplier_modules (ManyToManyField to shuup.core.models.SupplierModule) – Select the supplier module to use for this supplier. Supplier modules define the rules by which inventory is managed.
  • shops (ManyToManyField to shuup.core.models.Shop) – You can select which particular shops fronts the supplier should be available in.
  • description (TextField) – (Translatable) Description
background_tasks

ManyToOneRel to shuup.core.models.BackgroundTask

shipments

ManyToOneRel to shuup.core.models.Shipment

order_lines

ManyToOneRel to shuup.core.models.OrderLine

translations

ManyToOneRel to shuup.core.models._suppliers.SupplierTranslation

supplier_shops

ManyToOneRel to shuup.core.models.SupplierShop

log_entries

ManyToOneRel to shuup.core.models._suppliers.SupplierLogEntry

service_providers

ManyToOneRel to shuup.core.models.ServiceProvider

paymentmethod_set

ManyToOneRel to shuup.core.models.PaymentMethod

shippingmethod_set

ManyToOneRel to shuup.core.models.ShippingMethod

suppliedproduct_set

ManyToOneRel to shuup.core.models.SuppliedProduct

storedbasket_set

ManyToOneRel to shuup.front.models.stored_basket.StoredBasket

page_set

ManyToOneRel to shuup.simple_cms.models.Page

basket_campaigns

ManyToOneRel to shuup.campaigns.models.campaigns.BasketCampaign

campaign_coupons

ManyToOneRel to shuup.campaigns.models.campaigns.Coupon

stockadjustment_set

ManyToOneRel to shuup.simple_supplier.models.StockAdjustment

stockcount_set

ManyToOneRel to shuup.simple_supplier.models.StockCount

supplier_discounts

ManyToOneRel to shuup.discounts.models._discounts.Discount

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

add_log_entry(message, identifier=None, kind=<LogEntryKind.OTHER: 0>, user=None, extra=None, save=True)
adjust_stock(product_id, delta, created_by=None, type=None, *args, **kwargs)[source]
background_tasks

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

basket_campaigns

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

campaign_coupons

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

contact_address

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

contact_address_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

created_on

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

deleted

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

description

Descriptor for translated attributes.

This attribute proxies all get/set calls to the translated model.

enabled

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

get_next_by_created_on(*, field=<django.db.models.fields.DateTimeField: created_on>, is_next=True, **kwargs)
get_next_by_modified_on(*, field=<django.db.models.fields.DateTimeField: modified_on>, is_next=True, **kwargs)
get_orderability_errors(shop_product, quantity, customer, *args, **kwargs)[source]
Parameters:
Return type:

iterable[ValidationError]

get_previous_by_created_on(*, field=<django.db.models.fields.DateTimeField: created_on>, is_next=False, **kwargs)
get_previous_by_modified_on(*, field=<django.db.models.fields.DateTimeField: modified_on>, is_next=False, **kwargs)
get_stock_status(product_id, *args, **kwargs)[source]
get_stock_statuses(product_ids, *args, **kwargs)[source]

Return a dict of product stock statuses

Parameters:product_ids – Iterable of product IDs.
Returns:Dict of {product_id: ProductStockStatus}
Return type:dict[int, shuup.core.stocks.ProductStockStatus]
get_suppliable_products(shop, customer)[source]
Parameters:
Return type:

list[int]

get_type_display(*, field=<enumfields.fields.EnumIntegerField: type>)
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

identifier

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

log_entries

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

logo_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

modified_on

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

module_data

A placeholder class that provides a way to set the attribute on the model.

module_provides_key = 'supplier_module'
name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <django.db.models.manager.ManagerFromSupplierQueryset object>
options

A placeholder class that provides a way to set the attribute on the model.

order_lines

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

page_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

paymentmethod_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

save(*args, **kwargs)[source]
search_fields = ['name']
service_providers

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

ship_products(shipment, product_quantities, *args, **kwargs)[source]
shipments

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

shippingmethod_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

shop_products

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

shops

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

slug

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

soft_delete()[source]
stock_managed

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

stockadjustment_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

stockcount_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

storedbasket_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

suppliedproduct_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

supplier_discounts

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

supplier_modules

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

supplier_shops

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

translations

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

type

A property descriptor which ensures that field.to_python() is called on _every_ assignment to the field.

This used to be provided by the django.db.models.subclassing.Creator class, which in turn was used by the deprecated-in-Django-1.10 SubfieldBase class, hence the reimplementation here.

update_stock(product_id, *args, **kwargs)[source]
update_stocks(product_ids, *args, **kwargs)[source]
class shuup.core.models.SupplierShop(id, supplier, shop, is_approved)

Bases: django.db.models.base.Model

Parameters:
exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

is_approved

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <django.db.models.manager.Manager object>
shop

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

shop_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

supplier

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

supplier_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class shuup.core.models.SupplierType

Bases: enumfields.enums.Enum

An enumeration.

EXTERNAL = 2
INTERNAL = 1
class shuup.core.models.SupplierModule(id, module_identifier, name)

Bases: django.db.models.base.Model

Parameters:
  • id (AutoField) – Id
  • module_identifier (CharField) – Select the types of products this supplier can handle.Example for normal products select just Simple Supplier.
  • name (CharField) – Supplier modules name.
exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

classmethod ensure_all_supplier_modules()[source]
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

module_identifier

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <django.db.models.manager.Manager object>
suppliers

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

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. Mutually exclusive with the flat amount tax (flat tax is rarely used and the option is therefore hidden by default; contact Shuup to enable).
  • amount_value (MoneyValueField) – The flat amount of the tax. Mutually exclusive with percentage rates tax.
  • currency (CurrencyField) – Currency of the amount tax
  • enabled (BooleanField) – Enable if this tax is valid and should be active.
  • name (CharField) – (Translatable) The name of the tax. It 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 MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

add_log_entry(message, identifier=None, kind=<LogEntryKind.OTHER: 0>, user=None, extra=None, save=True)
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.

amount_value

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

calculate_amount(base_amount)[source]

Calculate tax amount with this tax for a given base amount.

Return type:shuup.utils.money.Money
change_protect_message = "Can't change the business critical fields of the Tax that is in use."
clean()[source]
code

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

currency

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

enabled

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

identifier_attr = 'code'
log_entries

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

name

Descriptor for translated attributes.

This attribute proxies all get/set calls to the translated model.

order_line_taxes

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

rate

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

taxrule_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

translations

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

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) – Enable if this tax class is valid and should be active.
  • name (CharField) – (Translatable) The tax class name. Tax classes are used to control how taxes are applied to the 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 MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

add_log_entry(message, identifier=None, kind=<LogEntryKind.OTHER: 0>, user=None, extra=None, save=True)
enabled

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

identifier

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

log_entries

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

name

Descriptor for translated attributes.

This attribute proxies all get/set calls to the translated model.

paymentmethod_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

product_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

shippingmethod_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

taxrule_set

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

translations

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

class shuup.core.models.TranslatableShuupModel(*args, **kwargs)

Bases: shuup.core.models.ShuupModel, parler.models.TranslatableModel

class Meta[source]

Bases: object

abstract = False
name_attr = 'name'
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 or internal units.

Initialize unit interface.

allow_bare_number

Allow showing values without the unit symbol.

Return type:bool
comparison_quantity

Quantity (in internal units) 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]

Returns 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 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, identifier, servicebehaviorcomponent_ptr, price_value, waive_limit_value)

Bases: shuup.core.models._service_base.TranslatableServiceBehaviorComponent

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.
  • servicebehaviorcomponent_ptr (OneToOneField to shuup.core.models.ServiceBehaviorComponent) – Servicebehaviorcomponent ptr
  • price_value (MoneyValueField) – The cost to apply to this service if the total price is below the waive limit.
  • waive_limit_value (MoneyValueField) – The total price of products limit, at which this service cost is waived.
  • description (CharField) – (Translatable) The order line text to display when this behavior is applied.
translations

ManyToOneRel to shuup.core.models._service_behavior.WaivingCostBehaviorComponentTranslation

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

description

Descriptor for translated attributes.

This attribute proxies all get/set calls to the translated model.

get_costs(service, source)[source]
help_text = 'If the total price of the products is less than a waive limit add cost to the price of the service.'
name = 'Waiving cost'
polymorphic_primary_key_name = 'id'
polymorphic_super_sub_accessors_replaced = False
price_value

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

servicebehaviorcomponent_ptr

Accessor to the related object on the forward side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Restaurant.place is a ForwardOneToOneDescriptor instance.

translations

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

waive_limit_value

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class shuup.core.models.WeightBasedPriceRange(id, component, min_value, max_value, price_value)

Bases: parler.models.TranslatableModel

Parameters:
translations

ManyToOneRel to shuup.core.models._service_behavior.WeightBasedPriceRangeTranslation

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

component

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

component_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

description

Descriptor for translated attributes.

This attribute proxies all get/set calls to the translated model.

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

matches_to_value(value)[source]
max_value

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

min_value

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

price_value

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

translations

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

class shuup.core.models.WeightBasedPricingBehaviorComponent(id, polymorphic_ctype, identifier, servicebehaviorcomponent_ptr)

Bases: shuup.core.models.ServiceBehaviorComponent

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.
  • servicebehaviorcomponent_ptr (OneToOneField to shuup.core.models.ServiceBehaviorComponent) – Servicebehaviorcomponent ptr
ranges

ManyToOneRel to shuup.core.models.WeightBasedPriceRange

exception DoesNotExist

Bases: shuup.core.models._service_base.DoesNotExist

exception MultipleObjectsReturned

Bases: shuup.core.models._service_base.MultipleObjectsReturned

get_costs(service, source)[source]
get_unavailability_reasons(service, source)[source]
help_text = "Define price based on basket weight. Range minimums are counted in range only as zero e.g. if there are 2 ranges (range1 = min 0, max 5; range2 = min 5, max 10), only range1's 'min 0' is going to be counted, but not range2's 'min 5'."
name = 'Weight-based pricing'
polymorphic_primary_key_name = 'id'
polymorphic_super_sub_accessors_replaced = False
ranges

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

servicebehaviorcomponent_ptr

Accessor to the related object on the forward side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Restaurant.place is a ForwardOneToOneDescriptor instance.

servicebehaviorcomponent_ptr_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class shuup.core.models.WeightLimitsBehaviorComponent(id, polymorphic_ctype, identifier, servicebehaviorcomponent_ptr, min_weight, max_weight)

Bases: shuup.core.models.ServiceBehaviorComponent

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.
  • servicebehaviorcomponent_ptr (OneToOneField to shuup.core.models.ServiceBehaviorComponent) – Servicebehaviorcomponent ptr
  • min_weight (DecimalField) – The minimum weight required for this service to be available.
  • max_weight (DecimalField) – The maximum weight allowed by this service.
exception DoesNotExist

Bases: shuup.core.models._service_base.DoesNotExist

exception MultipleObjectsReturned

Bases: shuup.core.models._service_base.MultipleObjectsReturned

get_unavailability_reasons(service, source)[source]
help_text = 'Limit availability of the service based on total weight of the products.'
max_weight

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

min_weight

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name = 'Weight limits'
polymorphic_primary_key_name = 'id'
polymorphic_super_sub_accessors_replaced = False
servicebehaviorcomponent_ptr

Accessor to the related object on the forward side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Restaurant.place is a ForwardOneToOneDescriptor instance.

servicebehaviorcomponent_ptr_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.