shuup.core.models package
Module contents
- class shuup.core.models.AbstractOrderLine(*args, **kwargs)
Bases:
MoneyPropped
,Model
,Priceful
- 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 hasincludes_tax
field.Operaters with
TaxfulPrice
andTaxlessPrice
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 hasincludes_tax
field.Operaters with
TaxfulPrice
andTaxlessPrice
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 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)
- 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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- property max_refundable_amount
shuup.utils.money.Money
- Type:
rtype
- property 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 aForwardManyToOneDescriptor
instance.
- parent_line_id
- product
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
- product_id
- quantity
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- property 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]
Save the current instance. Override this in a subclass if you want to control the saving process.
The ‘force_insert’ and ‘force_update’ parameters can be used to insist that the “save” must be an SQL insert or update (or equivalent for non-SQL backends), respectively. Normally, they should not be set.
- property 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 aForwardManyToOneDescriptor
instance.
- supplier_id
- property tax_amount
shuup.utils.money.Money
- Type:
rtype
- text
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- type
- 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:
MoneyPropped
,Model
- amount
Property for a Money amount.
Will return
Money
objects when the property is being get and acceptsMoney
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 toinstance.foo.bar
whereinstance
is an instance of the class owning theMoneyProperty
.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 anUnitMixupError
.
- 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 acceptsMoney
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 toinstance.foo.bar
whereinstance
is an instance of the class owning theMoneyProperty
.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 anUnitMixupError
.
- 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:
Contact
Replace Django’s inheritance accessor member functions for our model (self.__class__) with our own versions. We monkey patch them until a patch can be added to Django (which would probably be very small and make all of this obsolete).
If we have inheritance of the form ModelA -> ModelB ->ModelC then Django creates accessors like this: - ModelA: modelb - ModelB: modela_ptr, modelb, modelc - ModelC: modela_ptr, modelb, modelb_ptr, modelc
These accessors allow Django (and everyone else) to travel up and down the inheritance tree for the db object at hand.
The original Django accessors use our polymorphic manager. But they should not. So we replace them with our own accessors that use our appropriate base_objects manager.
- exception DoesNotExist
Bases:
DoesNotExist
- exception MultipleObjectsReturned
Bases:
MultipleObjectsReturned
- __init__(*args, **kwargs)[source]
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.
- 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 aForwardOneToOneDescriptor
instance.
- contact_ptr_id
- default_contact_group_identifier = 'default_anonymous_group'
- default_contact_group_name = 'Anonymous Contacts'
- groups
Contact groups accessor for anonymous contact.
The base class already has a
groups
property viaContactGroup
related_name, but this overrides it forAnonymousContact
so that it will return a queryset containing just the anonymous contact group rather than returning the original related manager, which cannot work sinceAnonymousContact
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
- class shuup.core.models.Attribute(id, identifier, searchable, type, min_choices, max_choices, visibility_mode, ordering)
Bases:
TranslatableModel
- exception DoesNotExist
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned
Bases:
MultipleObjectsReturned
- add_log_entry(message, identifier=None, kind=LogEntryKind.OTHER, 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 aReverseManyToOneDescriptor
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.
- property is_choices
- is_null_value(value)[source]
Find out whether the given value is null from this attribute’s point of view.
- property is_numeric
- property is_stringy
- property is_temporal
- property 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 aReverseManyToOneDescriptor
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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- 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 aReverseManyToOneDescriptor
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]
Save the current instance. Override this in a subclass if you want to control the saving process.
The ‘force_insert’ and ‘force_update’ parameters can be used to insist that the “save” must be an SQL insert or update (or equivalent for non-SQL backends), respectively. Normally, they should not be set.
- 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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- type
- visibility_mode
- class shuup.core.models.AttributeChoiceOption(id, attribute)
Bases:
TranslatableModel
- exception DoesNotExist
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned
Bases:
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 aForwardManyToOneDescriptor
instance.
- attribute_id
- 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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- translations
Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Parent.children
is aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- class shuup.core.models.AttributeType(value)
Bases:
Enum
- INTEGER = 1
- BOOLEAN = 2
- DECIMAL = 3
- TIMEDELTA = 4
- DATETIME = 10
- DATE = 11
- TRANSLATED_STRING = 20
- UNTRANSLATED_STRING = 21
- CHOICES = 22
- class shuup.core.models.AttributeVisibility(value)
Bases:
Enum
- HIDDEN = 0
- SHOW_ON_PRODUCT_PAGE = 1
- SEARCHABLE_FIELD = 2
- NOT_VISIBLE = 3
- class shuup.core.models.BackgroundTask(id, queue, identifier, created_on, modified_on, function, arguments, shop, supplier, user)
Bases:
Model
- exception DoesNotExist
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned
Bases:
MultipleObjectsReturned
- arguments
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.
- 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 aReverseManyToOneDescriptor
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 aForwardManyToOneDescriptor
instance.
- shop_id
- supplier
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
- supplier_id
- user
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
- user_id
- class shuup.core.models.BackgroundTaskExecution(id, task, started_on, finished_on, status, result, error_log)
Bases:
Model
- exception DoesNotExist
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned
Bases:
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 wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- 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
- 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 aForwardManyToOneDescriptor
instance.
- task_id
- class shuup.core.models.BackgroundTaskExecutionStatus(value)
Bases:
Enum
- RUNNING = 0
- SUCCESS = 1
- ERROR = 2
- Label = <class 'shuup.core.models._background_tasks.BackgroundTaskExecutionStatus.Label'>
- 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:
MoneyPropped
,Model
- exception DoesNotExist
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned
Bases:
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 aForwardManyToOneDescriptor
instance.
- creator_id
- 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 aForwardManyToOneDescriptor
instance.
- customer_id
- data
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.
- 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 aForwardManyToOneDescriptor
instance.
- orderer_id
- 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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- shop
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
- shop_id
- 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:
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 thecreate_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.Replace Django’s inheritance accessor member functions for our model (self.__class__) with our own versions. We monkey patch them until a patch can be added to Django (which would probably be very small and make all of this obsolete).
If we have inheritance of the form ModelA -> ModelB ->ModelC then Django creates accessors like this: - ModelA: modelb - ModelB: modela_ptr, modelb, modelc - ModelC: modela_ptr, modelb, modelb_ptr, modelc
These accessors allow Django (and everyone else) to travel up and down the inheritance tree for the db object at hand.
The original Django accessors use our polymorphic manager. But they should not. So we replace them with our own accessors that use our appropriate base_objects manager.
- exception DoesNotExist
Bases:
DoesNotExist
- exception MultipleObjectsReturned
Bases:
MultipleObjectsReturned
- add_log_entry(message, identifier=None, kind=LogEntryKind.OTHER, 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 aReverseOneToOneDescriptor
instance.
- log_entries
Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Parent.children
is aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- 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 aForwardOneToOneDescriptor
instance.
- serviceprovider_ptr_id
- 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 aReverseManyToOneDescriptor
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:
MPTTModel
,TranslatableModel
- exception DoesNotExist
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned
Bases:
MultipleObjectsReturned
- add_log_entry(message, identifier=None, kind=LogEntryKind.OTHER, 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 aReverseManyToOneDescriptor
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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- 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 aReverseManyToOneDescriptor
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]
Calling
delete
on a node will delete it as well as its full subtree, as opposed to reattaching all the subnodes to its parent node.There are no argument specific to a MPTT model, all the arguments will be passed directly to the django’s
Model.delete
.delete
will not return anything.
- 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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- get_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 aForwardManyToOneDescriptor
instance.
- image_id
- 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 aReverseManyToOneDescriptor
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 aForwardManyToOneDescriptor
instance.
- parent_id
- 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 aReverseManyToOneDescriptor
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]
If this is a new node, sets tree fields up before it is inserted into the database, making room in the tree structure as necessary, defaulting to making the new node the last child of its parent.
It the node’s left and right edge indicators already been set, we take this as indication that the node has already been set up for insertion, so its tree fields are left untouched.
If this is an existing node and its parent has been changed, performs reparenting in the tree structure, defaulting to making the node the last child of its new parent.
In either case, if the node’s class has its
order_insertion_by
tree option set, the node will be inserted or moved to the appropriate position to maintain ordering by the specified field.
- 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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- 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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- slug
Descriptor for translated attributes.
This attribute proxies all get/set calls to the translated model.
- status
- translations
Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Parent.children
is aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- tree_id
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- ultrafilte5
Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Parent.children
is aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- ultrafilte55
Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Parent.children
is aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- ultrafilter2
Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.
In the example:
class Pizza(Model): toppings = ManyToManyField(Topping, related_name='pizzas')
Pizza.toppings
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- visibility
- 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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
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.CategoryVisibility(value)
Bases:
Enum
- VISIBLE_TO_ALL = 1
- VISIBLE_TO_LOGGED_IN = 2
- VISIBLE_TO_GROUPS = 3
- 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:
Contact
Replace Django’s inheritance accessor member functions for our model (self.__class__) with our own versions. We monkey patch them until a patch can be added to Django (which would probably be very small and make all of this obsolete).
If we have inheritance of the form ModelA -> ModelB ->ModelC then Django creates accessors like this: - ModelA: modelb - ModelB: modela_ptr, modelb, modelc - ModelC: modela_ptr, modelb, modelb_ptr, modelc
These accessors allow Django (and everyone else) to travel up and down the inheritance tree for the db object at hand.
The original Django accessors use our polymorphic manager. But they should not. So we replace them with our own accessors that use our appropriate base_objects manager.
- exception DoesNotExist
Bases:
DoesNotExist
- exception MultipleObjectsReturned
Bases:
MultipleObjectsReturned
- add_log_entry(message, identifier=None, kind=LogEntryKind.OTHER, 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 aForwardOneToOneDescriptor
instance.
- contact_ptr_id
- default_contact_group_identifier = 'default_company_group'
- default_contact_group_name = 'Company Contacts'
- classmethod default_tax_group_getter()
- property 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 aReverseManyToOneDescriptor
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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- 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:
BaseLogEntry
- exception DoesNotExist
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned
Bases:
MultipleObjectsReturned
- get_kind_display(*, field=<enumfields.fields.EnumIntegerField: kind>)
- 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
- 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 aForwardManyToOneDescriptor
instance.
- target_id
- user
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
- class shuup.core.models.ConfigurationItem(id, shop, key, value)
Bases:
ShuupModel
- exception DoesNotExist
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned
Bases:
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 aForwardManyToOneDescriptor
instance.
- shop_id
- 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.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:
PolymorphicShuupModel
Replace Django’s inheritance accessor member functions for our model (self.__class__) with our own versions. We monkey patch them until a patch can be added to Django (which would probably be very small and make all of this obsolete).
If we have inheritance of the form ModelA -> ModelB ->ModelC then Django creates accessors like this: - ModelA: modelb - ModelB: modela_ptr, modelb, modelc - ModelC: modela_ptr, modelb, modelb_ptr, modelc
These accessors allow Django (and everyone else) to travel up and down the inheritance tree for the db object at hand.
The original Django accessors use our polymorphic manager. But they should not. So we replace them with our own accessors that use our appropriate base_objects manager.
- exception DoesNotExist
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned
Bases:
MultipleObjectsReturned
- __init__(*args, **kwargs)[source]
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.
- 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 aForwardManyToOneDescriptor
instance.
- account_manager_id
- 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 aReverseOneToOneDescriptor
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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- catalog_discounted_prices
Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Parent.children
is aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- catalog_prices
Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Parent.children
is aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- 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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- 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 aReverseOneToOneDescriptor
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 aReverseManyToOneDescriptor
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 aReverseManyToOneDescriptor
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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- contactcondition_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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- created_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 aReverseManyToOneDescriptor
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 aReverseManyToOneDescriptor
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 aReverseManyToOneDescriptor
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 aReverseManyToOneDescriptor
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 aForwardManyToOneDescriptor
instance.
- default_billing_address_id
- 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 aForwardManyToOneDescriptor
instance.
- default_payment_method_id
- 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 aForwardManyToOneDescriptor
instance.
- default_shipping_address_id
- 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 aForwardManyToOneDescriptor
instance.
- default_shipping_method_id
- 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.
- property 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:
- get_next_by_created_on(*, field=<django.db.models.fields.DateTimeField: created_on>, is_next=True, **kwargs)
- get_or_set_default_tax_group()[source]
Get the default tax group for this contact, setting it if not already set. This prevents database queries during __init__ which can cause polymorphic recursion.
- 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:
- 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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- property 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.
- 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
- property 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 wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- 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 aReverseOneToOneDescriptor
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 aForwardManyToOneDescriptor
instance.
- picture_id
- polymorphic_ctype
The model field that stores the
ContentType
reference to the actual class.
- 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.
- refresh_from_db(using=None, fields=None)[source]
Override refresh_from_db to prevent polymorphic recursion during deletion cascades.
The recursion happens when polymorphic queries try to refresh related Contact objects during deletion, causing infinite loops in field descriptor access.
- 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 aForwardManyToOneDescriptor
instance.
- registration_shop_id
- 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 aReverseManyToOneDescriptor
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 aReverseManyToOneDescriptor
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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- 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 aReverseManyToOneDescriptor
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 aForwardManyToOneDescriptor
instance.
- tax_group_id
- timezone
Use as the descriptor_class for a Django custom field. Allows setting the field to a serialized (typically string) value, and immediately reflecting that as the deserialized
to_python
value.(This requires that the field’s
to_python
returns the same thing whether called with a serialized or deserialized value.)
- ultrafilter_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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- 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:
TranslatableShuupModel
- exception DoesNotExist
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned
Bases:
MultipleObjectsReturned
- add_log_entry(message, identifier=None, kind=LogEntryKind.OTHER, user=None, extra=None, save=True)
- catalog_discounted_prices
Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Parent.children
is aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- catalog_prices
Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Parent.children
is aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- 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 aReverseManyToOneDescriptor
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 aReverseManyToOneDescriptor
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]
Hook for doing any extra model-wide validation after clean() has been called on every field by self.clean_fields. Any ValidationError raised by this method will not be associated with a particular field; it will have a special-case association with the field defined by NON_FIELD_ERRORS.
- 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 aReverseManyToOneDescriptor
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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- 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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- 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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- 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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- property 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.
- property 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 aReverseManyToOneDescriptor
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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- 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 aReverseManyToOneDescriptor
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]
Save the current instance. Override this in a subclass if you want to control the saving process.
The ‘force_insert’ and ‘force_update’ parameters can be used to insist that the “save” must be an SQL insert or update (or equivalent for non-SQL backends), respectively. Normally, they should not be set.
- shop
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
- shop_id
- property show_prices_including_taxes
- property 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 aReverseManyToOneDescriptor
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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- 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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- class shuup.core.models.ContactGroupLogEntry(id, created_on, user, message, identifier, kind, extra, target)
Bases:
BaseLogEntry
- exception DoesNotExist
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned
Bases:
MultipleObjectsReturned
- get_kind_display(*, field=<enumfields.fields.EnumIntegerField: kind>)
- 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
- 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 aForwardManyToOneDescriptor
instance.
- target_id
- user
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
- class shuup.core.models.ContactGroupPriceDisplay(id, shop, group, show_pricing, show_prices_including_taxes, hide_prices)
Bases:
Model
- exception DoesNotExist
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned
Bases:
MultipleObjectsReturned
- group
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
- group_id
- 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 aForwardManyToOneDescriptor
instance.
- shop_id
- 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.
- class shuup.core.models.Counter(id, value)
Bases:
Model
- exception DoesNotExist
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned
Bases:
MultipleObjectsReturned
- get_id_display(*, field=<enumfields.fields.EnumIntegerField: id>)
- id
- 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.CountryLimitBehaviorComponent(id, polymorphic_ctype, identifier, servicebehaviorcomponent_ptr, available_in_countries, available_in_european_countries, unavailable_in_countries, unavailable_in_european_countries)
Bases:
ServiceBehaviorComponent
Replace Django’s inheritance accessor member functions for our model (self.__class__) with our own versions. We monkey patch them until a patch can be added to Django (which would probably be very small and make all of this obsolete).
If we have inheritance of the form ModelA -> ModelB ->ModelC then Django creates accessors like this: - ModelA: modelb - ModelB: modela_ptr, modelb, modelc - ModelC: modela_ptr, modelb, modelb_ptr, modelc
These accessors allow Django (and everyone else) to travel up and down the inheritance tree for the db object at hand.
The original Django accessors use our polymorphic manager. But they should not. So we replace them with our own accessors that use our appropriate base_objects manager.
- exception DoesNotExist
Bases:
DoesNotExist
- exception MultipleObjectsReturned
Bases:
MultipleObjectsReturned
- available_in_countries
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- 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.
- 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 aForwardOneToOneDescriptor
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.
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:
Carrier
Carrier without any integration or special processing.
Replace Django’s inheritance accessor member functions for our model (self.__class__) with our own versions. We monkey patch them until a patch can be added to Django (which would probably be very small and make all of this obsolete).
If we have inheritance of the form ModelA -> ModelB ->ModelC then Django creates accessors like this: - ModelA: modelb - ModelB: modela_ptr, modelb, modelc - ModelC: modela_ptr, modelb, modelb_ptr, modelc
These accessors allow Django (and everyone else) to travel up and down the inheritance tree for the db object at hand.
The original Django accessors use our polymorphic manager. But they should not. So we replace them with our own accessors that use our appropriate base_objects manager.
- exception DoesNotExist
Bases:
DoesNotExist
- exception MultipleObjectsReturned
Bases:
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 aForwardOneToOneDescriptor
instance.
- carrier_ptr_id
- carrierwithcheckoutphase
Accessor to the related object on the reverse side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Place.restaurant
is aReverseOneToOneDescriptor
instance.
- get_service_choices()[source]
Get all service choices of this provider.
Subclasses should implement this method.
- Return type:
- polymorphic_primary_key_name = 'id'
- polymorphic_super_sub_accessors_replaced = False
- class shuup.core.models.CustomerTaxGroup(id, identifier, enabled)
Bases:
TranslatableShuupModel
- exception DoesNotExist
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned
Bases:
MultipleObjectsReturned
- add_log_entry(message, identifier=None, kind=LogEntryKind.OTHER, 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 aReverseManyToOneDescriptor
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.
- 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 aReverseManyToOneDescriptor
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 aReverseManyToOneDescriptor
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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- translations
Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Parent.children
is aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- class shuup.core.models.CustomPaymentProcessor(*args, **kwargs)
Bases:
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.
Replace Django’s inheritance accessor member functions for our model (self.__class__) with our own versions. We monkey patch them until a patch can be added to Django (which would probably be very small and make all of this obsolete).
If we have inheritance of the form ModelA -> ModelB ->ModelC then Django creates accessors like this: - ModelA: modelb - ModelB: modela_ptr, modelb, modelc - ModelC: modela_ptr, modelb, modelb_ptr, modelc
These accessors allow Django (and everyone else) to travel up and down the inheritance tree for the db object at hand.
The original Django accessors use our polymorphic manager. But they should not. So we replace them with our own accessors that use our appropriate base_objects manager.
- exception DoesNotExist
Bases:
DoesNotExist
- exception MultipleObjectsReturned
Bases:
MultipleObjectsReturned
- get_rounding_mode_display(*, field=<enumfields.fields.EnumField: rounding_mode>)
- get_service_choices()[source]
Get all service choices of this provider.
Subclasses should implement this method.
- Return type:
- 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 aForwardOneToOneDescriptor
instance.
- paymentprocessor_ptr_id
- paymentwithcheckoutphase
Accessor to the related object on the reverse side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Place.restaurant
is aReverseOneToOneDescriptor
instance.
- 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 toDEFERRED
if it isNOT_PAID
.- Return type:
None
- rounding_mode
- 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:
Model
- exception DoesNotExist
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned
Bases:
MultipleObjectsReturned
- add_log_entry(message, identifier=None, kind=LogEntryKind.OTHER, user=None, extra=None, save=True)
- clean()[source]
Hook for doing any extra model-wide validation after clean() has been called on every field by self.clean_fields. Any ValidationError raised by this method will not be associated with a particular field; it will have a special-case association with the field defined by NON_FIELD_ERRORS.
- 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 aReverseManyToOneDescriptor
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]
Save the current instance. Override this in a subclass if you want to control the saving process.
The ‘force_insert’ and ‘force_update’ parameters can be used to insist that the “save” must be an SQL insert or update (or equivalent for non-SQL backends), respectively. Normally, they should not be set.
- class shuup.core.models.DefaultOrderStatus(value)
Bases:
Enum
- NONE = 'none'
- INITIAL = 'initial'
- COMPLETE = 'complete'
- CANCELED = 'canceled'
- PROCESSING = 'processing'
- class shuup.core.models.DisplayUnit(id, internal_unit, ratio, decimals, comparison_value, allow_bare_number, default)
Bases:
TranslatableShuupModel
- exception DoesNotExist
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned
Bases:
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 aForwardManyToOneDescriptor
instance.
- internal_unit_id
- 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 aReverseManyToOneDescriptor
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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- class shuup.core.models.EncryptedConfigurationItem(id, shop, key, value)
Bases:
ShuupModel
- exception DoesNotExist
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned
Bases:
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 aForwardManyToOneDescriptor
instance.
- shop_id
- 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.FixedCostBehaviorComponent(id, polymorphic_ctype, identifier, servicebehaviorcomponent_ptr, price_value)
Bases:
TranslatableServiceBehaviorComponent
Replace Django’s inheritance accessor member functions for our model (self.__class__) with our own versions. We monkey patch them until a patch can be added to Django (which would probably be very small and make all of this obsolete).
If we have inheritance of the form ModelA -> ModelB ->ModelC then Django creates accessors like this: - ModelA: modelb - ModelB: modela_ptr, modelb, modelc - ModelC: modela_ptr, modelb, modelb_ptr, modelc
These accessors allow Django (and everyone else) to travel up and down the inheritance tree for the db object at hand.
The original Django accessors use our polymorphic manager. But they should not. So we replace them with our own accessors that use our appropriate base_objects manager.
- exception DoesNotExist
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned
Bases:
MultipleObjectsReturned
- description
Descriptor for translated attributes.
This attribute proxies all get/set calls to the translated model.
- 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
andPaymentMethod
objects.
- 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 aForwardOneToOneDescriptor
instance.
- translations
Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Parent.children
is aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- 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 theCurrency
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:
- 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(value)
Bases:
Enum
- UNDISCLOSED = 'u'
- MALE = 'm'
- FEMALE = 'f'
- OTHER = 'o'
- class shuup.core.models.GroupAvailabilityBehaviorComponent(id, polymorphic_ctype, identifier, servicebehaviorcomponent_ptr)
Bases:
ServiceBehaviorComponent
Replace Django’s inheritance accessor member functions for our model (self.__class__) with our own versions. We monkey patch them until a patch can be added to Django (which would probably be very small and make all of this obsolete).
If we have inheritance of the form ModelA -> ModelB ->ModelC then Django creates accessors like this: - ModelA: modelb - ModelB: modela_ptr, modelb, modelc - ModelC: modela_ptr, modelb, modelb_ptr, modelc
These accessors allow Django (and everyone else) to travel up and down the inheritance tree for the db object at hand.
The original Django accessors use our polymorphic manager. But they should not. So we replace them with our own accessors that use our appropriate base_objects manager.
- exception DoesNotExist
Bases:
DoesNotExist
- exception MultipleObjectsReturned
Bases:
MultipleObjectsReturned
- groups
Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.
In the example:
class Pizza(Model): toppings = ManyToManyField(Topping, related_name='pizzas')
Pizza.toppings
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- 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 aForwardOneToOneDescriptor
instance.
- servicebehaviorcomponent_ptr_id
- class shuup.core.models.ImmutableAddress(*args, **kwargs)
Bases:
ChangeProtected
,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 existingMutableAddress
with theAddress.to_immutable()
method.- exception DoesNotExist
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned
Bases:
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 aReverseManyToOneDescriptor
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:
- Returns:
Saved immutable address
- Return type:
- get_country_display(*, field=<django_countries.fields.CountryField: country>)
- 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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- class shuup.core.models.Label(id, identifier, created_on, modified_on)
Bases:
TranslatableShuupModel
- exception DoesNotExist
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned
Bases:
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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- 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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- 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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- 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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- translations
Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Parent.children
is aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- class shuup.core.models.Manufacturer(id, created_on, identifier, name, url, logo)
Bases:
Model
- exception DoesNotExist
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned
Bases:
MultipleObjectsReturned
- add_log_entry(message, identifier=None, kind=LogEntryKind.OTHER, 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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- logo
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
- logo_id
- 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 aReverseManyToOneDescriptor
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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- 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:
Model
- exception DoesNotExist
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned
Bases:
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 aForwardManyToOneDescriptor
instance.
- file_id
- 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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- class shuup.core.models.MediaFolder(id, folder, visible)
Bases:
Model
- exception DoesNotExist
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned
Bases:
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 aForwardManyToOneDescriptor
instance.
- folder_id
- 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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- 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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- 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:
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 theto_mutable
method ofAddress
objects.- exception DoesNotExist
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned
Bases:
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:
- Returns:
Unsaved mutable address
- Return type:
- get_country_display(*, field=<django_countries.fields.CountryField: country>)
- 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 aReverseManyToOneDescriptor
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 aReverseManyToOneDescriptor
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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- class shuup.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:
MoneyPropped
,Model
- exception DoesNotExist
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned
Bases:
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 aForwardManyToOneDescriptor
instance.
- account_manager_id
- add_log_entry(message, identifier=None, kind=LogEntryKind.OTHER, 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 aForwardManyToOneDescriptor
instance.
- billing_address_id
- change_status(next_status: OrderStatus, user: User = None, description: str = None, save=True, first_save=False)[source]
- property 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 aReverseManyToOneDescriptor
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 (wherenumber
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:
- 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
typeOrderLineType.PRODUCT
and therestock_products
boolean flag is set toTrue
, the products will be restocked with the exact amount set in the order supplier’squantity
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:
- 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 aForwardManyToOneDescriptor
instance.
- creator_id
- 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 aForwardManyToOneDescriptor
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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- customer_id
- deleted
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- 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 wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- full_clean(exclude=None, validate_unique=True)[source]
Call clean_fields(), clean(), and validate_unique() on the model. Raise a ValidationError for any errors that occur.
- get_known_additional_data()[source]
Get a list of “known additional data” in this order’s
payment_data
,shipping_data
andextra_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_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_summary(supplier=None)[source]
Return a dict of product IDs -> {ordered, unshipped, refunded, shipped, line_text, suppliers}
- get_shipping_status_display(*, field=<enumfields.fields.EnumIntegerField: shipping_status>)
- 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.
- 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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- log_entries
Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Parent.children
is aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- 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 aForwardManyToOneDescriptor
instance.
- modified_by_id
- 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.
- order_history
Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Parent.children
is aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- 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 aForwardManyToOneDescriptor
instance.
- orderer_id
- payment_data
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- 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 aForwardManyToOneDescriptor
instance.
- payment_method_id
- 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
- 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 aReverseManyToOneDescriptor
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]
Save the current instance. Override this in a subclass if you want to control the saving process.
The ‘force_insert’ and ‘force_update’ parameters can be used to insist that the “save” must be an SQL insert or update (or equivalent for non-SQL backends), respectively. Normally, they should not be set.
- 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 aReverseManyToOneDescriptor
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 aForwardManyToOneDescriptor
instance.
- shipping_address_id
- shipping_data
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- 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 aForwardManyToOneDescriptor
instance.
- shipping_method_id
- 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
- shop
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
- shop_id
- 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 aForwardManyToOneDescriptor
instance.
- status_id
- 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 aForwardManyToOneDescriptor
instance.
- tax_group_id
- 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.
- 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:
LineWithUnit
,AbstractOrderLine
- exception DoesNotExist
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned
Bases:
MultipleObjectsReturned
- add_log_entry(message, identifier=None, kind=LogEntryKind.OTHER, 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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- get_next_by_created_on(*, field=<django.db.models.fields.DateTimeField: created_on>, is_next=True, **kwargs)
- get_next_by_modified_on(*, field=<django.db.models.fields.DateTimeField: modified_on>, is_next=True, **kwargs)
- get_previous_by_created_on(*, field=<django.db.models.fields.DateTimeField: created_on>, is_next=False, **kwargs)
- get_previous_by_modified_on(*, field=<django.db.models.fields.DateTimeField: modified_on>, is_next=False, **kwargs)
- get_type_display(*, field=<enumfields.fields.EnumIntegerField: type>)
Return the display label for the order line type.
- 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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- log_entries
Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Parent.children
is aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- order
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
- order_id
- 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 aForwardManyToOneDescriptor
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 aForwardManyToOneDescriptor
instance.
- property 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 aForwardManyToOneDescriptor
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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- type
- class shuup.core.models.OrderLineTax(id, order_line, tax, name, amount_value, base_amount_value, ordering)
Bases:
MoneyPropped
,ShuupModel
,LineTax
- exception DoesNotExist
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned
Bases:
MultipleObjectsReturned
- add_log_entry(message, identifier=None, kind=LogEntryKind.OTHER, user=None, extra=None, save=True)
- amount
Property for a Money amount.
Will return
Money
objects when the property is being get and acceptsMoney
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 toinstance.foo.bar
whereinstance
is an instance of the class owning theMoneyProperty
.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 anUnitMixupError
.
- 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 acceptsMoney
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 toinstance.foo.bar
whereinstance
is an instance of the class owning theMoneyProperty
.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 anUnitMixupError
.
- 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 aReverseManyToOneDescriptor
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 aForwardManyToOneDescriptor
instance.
- order_line_id
- 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 aForwardManyToOneDescriptor
instance.
- tax_id
- class shuup.core.models.OrderLineType(value)
Bases:
Enum
- PRODUCT = 1
- SHIPPING = 2
- PAYMENT = 3
- DISCOUNT = 4
- OTHER = 5
- REFUND = 6
- ROUNDING = 7
- class shuup.core.models.OrderLogEntry(id, created_on, user, message, identifier, kind, extra, target)
Bases:
BaseLogEntry
- exception DoesNotExist
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned
Bases:
MultipleObjectsReturned
- get_kind_display(*, field=<enumfields.fields.EnumIntegerField: kind>)
- 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
- objects = <django.db.models.manager.Manager object>
- target
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
- target_id
- user
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
- class shuup.core.models.OrderStatus(id, identifier, ordering, role, default, is_active, visible_for_customer)
Bases:
TranslatableModel
- exception DoesNotExist
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned
Bases:
MultipleObjectsReturned
- allowed_next_statuses
Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.
In the example:
class Pizza(Model): toppings = ManyToManyField(Topping, related_name='pizzas')
Pizza.toppings
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- 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.
- next_order_status
Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Parent.children
is aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- 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 aReverseManyToOneDescriptor
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.
- orderstatus_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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- previous_order_status
Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Parent.children
is aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- public_name
Descriptor for translated attributes.
This attribute proxies all get/set calls to the translated model.
- role
- save(*args, **kwargs)[source]
Save the current instance. Override this in a subclass if you want to control the saving process.
The ‘force_insert’ and ‘force_update’ parameters can be used to insist that the “save” must be an SQL insert or update (or equivalent for non-SQL backends), respectively. Normally, they should not be set.
- translations
Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Parent.children
is aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- visible_for_customer
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.OrderStatusHistory(id, order, previous_order_status, next_order_status, created_on, description, creator)
Bases:
Model
- exception DoesNotExist
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned
Bases:
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 aForwardManyToOneDescriptor
instance.
- creator_id
- 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)
- id
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- next_order_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 aForwardManyToOneDescriptor
instance.
- next_order_status_id
- 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 aForwardManyToOneDescriptor
instance.
- order_id
- previous_order_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 aForwardManyToOneDescriptor
instance.
- previous_order_status_id
- class shuup.core.models.OrderStatusManager
Bases:
object
- class shuup.core.models.OrderStatusRole(value)
Bases:
Enum
- NONE = 0
- INITIAL = 1
- COMPLETE = 2
- CANCELED = 3
- PROCESSING = 4
- class shuup.core.models.OrderTotalLimitBehaviorComponent(id, polymorphic_ctype, identifier, servicebehaviorcomponent_ptr, min_price_value, max_price_value)
Bases:
ServiceBehaviorComponent
Replace Django’s inheritance accessor member functions for our model (self.__class__) with our own versions. We monkey patch them until a patch can be added to Django (which would probably be very small and make all of this obsolete).
If we have inheritance of the form ModelA -> ModelB ->ModelC then Django creates accessors like this: - ModelA: modelb - ModelB: modela_ptr, modelb, modelc - ModelC: modela_ptr, modelb, modelb_ptr, modelc
These accessors allow Django (and everyone else) to travel up and down the inheritance tree for the db object at hand.
The original Django accessors use our polymorphic manager. But they should not. So we replace them with our own accessors that use our appropriate base_objects manager.
- exception DoesNotExist
Bases:
DoesNotExist
- exception MultipleObjectsReturned
Bases:
MultipleObjectsReturned
- 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 aForwardOneToOneDescriptor
instance.
- servicebehaviorcomponent_ptr_id
- class shuup.core.models.Payment(id, created_on, gateway_id, payment_identifier, amount_value, foreign_amount_value, foreign_currency, description, order)
Bases:
AbstractPayment
- exception DoesNotExist
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned
Bases:
MultipleObjectsReturned
- add_log_entry(message, identifier=None, kind=LogEntryKind.OTHER, user=None, extra=None, save=True)
- property 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 aReverseManyToOneDescriptor
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 aForwardManyToOneDescriptor
instance.
- order_id
- class shuup.core.models.PaymentMethod(id, identifier, enabled, shop, supplier, choice_identifier, old_module_identifier, old_module_data, logo, tax_class, payment_processor)
Bases:
Service
- exception DoesNotExist
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned
Bases:
MultipleObjectsReturned
- add_log_entry(message, identifier=None, kind=LogEntryKind.OTHER, 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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- 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 aReverseManyToOneDescriptor
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.
- 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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- 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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- logo
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
- name
Descriptor for translated attributes.
This attribute proxies all get/set calls to the translated 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 aReverseManyToOneDescriptor
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 aForwardManyToOneDescriptor
instance.
- payment_processor_id
- 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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- 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 aForwardManyToOneDescriptor
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 aForwardManyToOneDescriptor
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 aForwardManyToOneDescriptor
instance.
- translations
Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Parent.children
is aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- class shuup.core.models.PaymentProcessor(*args, **kwargs)
Bases:
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 thecreate_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
andprocess_payment_return_request
methods.Note:
PaymentProcessor
objects should never be created on their own but rather through a concrete subclass.Replace Django’s inheritance accessor member functions for our model (self.__class__) with our own versions. We monkey patch them until a patch can be added to Django (which would probably be very small and make all of this obsolete).
If we have inheritance of the form ModelA -> ModelB ->ModelC then Django creates accessors like this: - ModelA: modelb - ModelB: modela_ptr, modelb, modelc - ModelC: modela_ptr, modelb, modelb_ptr, modelc
These accessors allow Django (and everyone else) to travel up and down the inheritance tree for the db object at hand.
The original Django accessors use our polymorphic manager. But they should not. So we replace them with our own accessors that use our appropriate base_objects manager.
- exception DoesNotExist
Bases:
DoesNotExist
- exception MultipleObjectsReturned
Bases:
MultipleObjectsReturned
- add_log_entry(message, identifier=None, kind=LogEntryKind.OTHER, 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 aReverseOneToOneDescriptor
instance.
- get_payment_process_response(service, order, urls)[source]
Get payment process response for a given order.
- Return type:
- log_entries
Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Parent.children
is aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- 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 aReverseManyToOneDescriptor
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 toDEFERRED
if it isNOT_PAID
.- Return type:
None
- pseudopaymentprocessor
Accessor to the related object on the reverse side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Place.restaurant
is aReverseOneToOneDescriptor
instance.
- 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 aForwardOneToOneDescriptor
instance.
- serviceprovider_ptr_id
- class shuup.core.models.PaymentStatus(value)
Bases:
Enum
- NOT_PAID = 0
- PARTIALLY_PAID = 1
- FULLY_PAID = 2
- CANCELED = 3
- DEFERRED = 4
- 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:
Model
- exception DoesNotExist
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned
Bases:
MultipleObjectsReturned
- data
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_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:
Contact
Replace Django’s inheritance accessor member functions for our model (self.__class__) with our own versions. We monkey patch them until a patch can be added to Django (which would probably be very small and make all of this obsolete).
If we have inheritance of the form ModelA -> ModelB ->ModelC then Django creates accessors like this: - ModelA: modelb - ModelB: modela_ptr, modelb, modelc - ModelC: modela_ptr, modelb, modelb_ptr, modelc
These accessors allow Django (and everyone else) to travel up and down the inheritance tree for the db object at hand.
The original Django accessors use our polymorphic manager. But they should not. So we replace them with our own accessors that use our appropriate base_objects manager.
- exception DoesNotExist
Bases:
DoesNotExist
- exception MultipleObjectsReturned
Bases:
MultipleObjectsReturned
- __init__(*args, **kwargs)[source]
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.
- add_log_entry(message, identifier=None, kind=LogEntryKind.OTHER, 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 aForwardOneToOneDescriptor
instance.
- contact_ptr_id
- 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 aReverseManyToOneDescriptor
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'
- classmethod 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.
- property full_name
Get the full name computed from first_name and last_name.
- gender
- get_gender_display(*, field=<enumfields.fields.EnumField: gender>)
- property is_all_seeing
bool(x) -> bool
Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.
- 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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- 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 aReverseManyToOneDescriptor
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 aReverseManyToOneDescriptor
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 aReverseManyToOneDescriptor
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 aReverseManyToOneDescriptor
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
- 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 aForwardOneToOneDescriptor
instance.
- user_id
- class shuup.core.models.PersonContactLogEntry(id, created_on, user, message, identifier, kind, extra, target)
Bases:
BaseLogEntry
- exception DoesNotExist
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned
Bases:
MultipleObjectsReturned
- get_kind_display(*, field=<enumfields.fields.EnumIntegerField: kind>)
- 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
- 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 aForwardManyToOneDescriptor
instance.
- target_id
- user
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
- class shuup.core.models.PiecesSalesUnit
Bases:
SalesUnit
An object representing
Pieces
sales unit.Has same API as SalesUnit, but isn’t a real model.
- exception DoesNotExist
Bases:
DoesNotExist
- exception MultipleObjectsReturned
Bases:
MultipleObjectsReturned
- property 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:
- name = 'Pieces'
- property pk
- symbol = 'pc.'
- class shuup.core.models.PolymorphicShuupModel(*args, **kwargs)
Bases:
PolymorphicModel
,ShuupModel
Shuup polymorphic model with recursion-safe polymorphic type field.
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.
- polymorphic_ctype
The model field that stores the
ContentType
reference to the actual class.
- polymorphic_super_sub_accessors_replaced = False
- class shuup.core.models.PolymorphicTranslatableShuupModel(*args, **kwargs)
Bases:
PolymorphicShuupModel
,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.
- objects
- polymorphic_ctype
The model field that stores the
ContentType
reference to the actual class.
- 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:
TaxableItem
,AttributableMixin
,TranslatableModel
- COMMON_PREFETCH_RELATED = ('translations',)
- COMMON_SELECT_RELATED = ('sales_unit', 'type', 'primary_image', 'tax_class', 'manufacturer')
- exception DoesNotExist
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned
Bases:
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, 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 aReverseManyToOneDescriptor
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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- catalog_discounted_prices
Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Parent.children
is aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- catalog_prices
Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Parent.children
is aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- 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 aReverseManyToOneDescriptor
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]
Hook for doing any extra model-wide validation after clean() has been called on every field by self.clean_fields. Any ValidationError raised by this method will not be associated with a particular field; it will have a special-case association with the field defined by NON_FIELD_ERRORS.
- 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 aReverseManyToOneDescriptor
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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- 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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- 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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- get_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_available_variation_results()[source]
Get a dict of
combination_hash
to product ID of variable variation results.
- 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:
- 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
ifself.variation_children
do not exist. This is because we cannot return anything sensible.- Return type:
- 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
) ifself.variation_children
do not exist. This is because we cannot return anything sensible.- Returns:
a tuple of prices.
- Return type:
- 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_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 top.get_price(ctx, quantity=123)
, since there could be quantity discounts in effect, but usually they are equal.- Return type:
- get_price_info(context, quantity=1)[source]
Get
PriceInfo
object for the product in given context.Returned
PriceInfo
object contains calculatedprice
andbase_price
. The calculation of prices is handled in the current pricing module.- Return type:
- get_priced_children(context, quantity=1)[source]
Get child products with price infos sorted by price.
- get_shipping_mode_display(*, field=<enumfields.fields.EnumIntegerField: shipping_mode>)
- 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.
- 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.
- 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 aReverseManyToOneDescriptor
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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- log_entries
Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Parent.children
is aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- 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 aForwardManyToOneDescriptor
instance.
- manufacturer_id
- 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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- mode
- 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 aReverseManyToOneDescriptor
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 aForwardManyToOneDescriptor
instance.
- primary_image_id
- 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 aReverseManyToOneDescriptor
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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- 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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- 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 aForwardManyToOneDescriptor
instance.
- sales_unit_id
- save(*args, **kwargs)[source]
Save the current instance. Override this in a subclass if you want to control the saving process.
The ‘force_insert’ and ‘force_update’ parameters can be used to insist that the “save” must be an SQL insert or update (or equivalent for non-SQL backends), respectively. Normally, they should not be set.
- 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 aReverseManyToOneDescriptor
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
- shop_products
Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Parent.children
is aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- 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 aReverseManyToOneDescriptor
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.
- 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 aReverseManyToOneDescriptor
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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- 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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- supplierprice_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 aReverseManyToOneDescriptor
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: ForeignKey
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
- tax_class_id
- translations
Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Parent.children
is aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- 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 aForwardManyToOneDescriptor
instance.
- type_id
- ultrafilter1
Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.
In the example:
class Pizza(Model): toppings = ManyToManyField(Topping, related_name='pizzas')
Pizza.toppings
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- ultrafilter_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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- 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 aReverseManyToOneDescriptor
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 aForwardManyToOneDescriptor
instance.
- variation_parent_id
- 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 aReverseManyToOneDescriptor
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 aReverseManyToOneDescriptor
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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- 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:
AppliedAttribute
- exception DoesNotExist
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned
Bases:
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 aForwardManyToOneDescriptor
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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- 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 aForwardManyToOneDescriptor
instance.
- product_id
- 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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- class shuup.core.models.ProductCatalogPrice(*args, **kwargs)
Bases:
MoneyPropped
,Model
Index the prices of products. There can be multiple prices, the best price will be selected.
- exception DoesNotExist
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned
Bases:
MultipleObjectsReturned
- catalog_rule
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
- catalog_rule_id
- id
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- is_available
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>
- price
Property for Price object.
Similar to
MoneyProperty
, but also hasincludes_tax
field.Operaters with
TaxfulPrice
andTaxlessPrice
objects.
- price_value
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 aForwardManyToOneDescriptor
instance.
- product_id
- shop
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
- shop_id
- supplier
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
- supplier_id
- class shuup.core.models.ProductCatalogPriceRule(*args, **kwargs)
Bases:
Model
Store rules for catalog prices
- exception DoesNotExist
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned
Bases:
MultipleObjectsReturned
- contact
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
- contact_group
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
- contact_group_id
- contact_id
- 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.
- objects = <django.db.models.manager.Manager object>
- productcatalogprice_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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- class shuup.core.models.ProductCatalogDiscountedPrice(*args, **kwargs)
Bases:
MoneyPropped
,Model
Index the discounted prices of products. There can be multiple discounted prices, the best discounted price will be selected.
- exception DoesNotExist
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned
Bases:
MultipleObjectsReturned
- catalog_rule
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
- catalog_rule_id
- discounted_price
Property for Price object.
Similar to
MoneyProperty
, but also hasincludes_tax
field.Operaters with
TaxfulPrice
andTaxlessPrice
objects.
- discounted_price_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.
- 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 aForwardManyToOneDescriptor
instance.
- product_id
- shop
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
- shop_id
- supplier
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
- supplier_id
- class shuup.core.models.ProductCatalogDiscountedPriceRule(*args, **kwargs)
Bases:
Model
Store rules for discounted prices
- exception DoesNotExist
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned
Bases:
MultipleObjectsReturned
- contact
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
- contact_group
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
- contact_group_id
- contact_id
- get_valid_weekday_display(*, field=<enumfields.fields.EnumIntegerField: valid_weekday>)
- 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.
- objects = <django.db.models.manager.Manager object>
- productcatalogdiscountedprice_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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- valid_end_date
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- valid_end_hour
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- valid_start_date
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- valid_start_hour
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- valid_weekday
- class shuup.core.models.ProductCrossSell(id, product1, product2, weight, type)
Bases:
Model
- exception DoesNotExist
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned
Bases:
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 aForwardManyToOneDescriptor
instance.
- product1_id
- 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 aForwardManyToOneDescriptor
instance.
- product2_id
- type
- 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(value)
Bases:
Enum
- RECOMMENDED = 1
- RELATED = 2
- COMPUTED = 3
- BOUGHT_WITH = 4
- class shuup.core.models.ProductMedia(id, identifier, product, kind, file, external_url, ordering, enabled, public, purchased)
Bases:
TranslatableModel
- exception DoesNotExist
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned
Bases:
MultipleObjectsReturned
- add_log_entry(message, identifier=None, kind=LogEntryKind.OTHER, user=None, extra=None, save=True)
- description
Descriptor for translated attributes.
This attribute proxies all get/set calls to the translated model.
- property easy_thumbnails_thumbnailer
Get
Thumbnailer
instance.Will return
None
if file cannot be thumbnailed.:rtype:easy_thumbnails.files.Thumbnailer|None
- property 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 aForwardManyToOneDescriptor
instance.
- file_id
- 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 notProductMediaKind.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
- log_entries
Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Parent.children
is aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- 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 aReverseManyToOneDescriptor
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 aReverseManyToOneDescriptor
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 aForwardManyToOneDescriptor
instance.
- product_id
- 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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- 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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- property url
- class shuup.core.models.ProductMediaKind(value)
Bases:
Enum
- GENERIC_FILE = 1
- IMAGE = 2
- DOCUMENTATION = 3
- SAMPLE = 4
- class shuup.core.models.ProductMode(value)
Bases:
Enum
- classmethod get_parent_modes() Iterable[ProductMode] [source]
Returns a list of modes that are parents, likely the products that are listed in frontend
- NORMAL = 0
- PACKAGE_PARENT = 1
- SIMPLE_VARIATION_PARENT = 2
- VARIABLE_VARIATION_PARENT = 3
- VARIATION_CHILD = 4
- SUBSCRIPTION = 5
- class shuup.core.models.ProductPackageLink(id, parent, child, quantity)
Bases:
Model
- exception DoesNotExist
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned
Bases:
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 aForwardManyToOneDescriptor
instance.
- child_id
- 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 aForwardManyToOneDescriptor
instance.
- parent_id
- 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:
TranslatableModel
- exception DoesNotExist
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned
Bases:
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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- 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 aReverseManyToOneDescriptor
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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- translations
Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Parent.children
is aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- ultrafilter3
Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.
In the example:
class Pizza(Model): toppings = ManyToManyField(Topping, related_name='pizzas')
Pizza.toppings
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- ultrafilter_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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- class shuup.core.models.ProductVariationResult(id, product, combination_hash, result, status)
Bases:
Model
- exception DoesNotExist
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned
Bases:
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 aForwardManyToOneDescriptor
instance.
- product_id
- 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 aForwardManyToOneDescriptor
instance.
- result_id
- status
- class shuup.core.models.ProductVariationVariable(id, ordering, product, identifier)
Bases:
TranslatableModel
,SortableMixin
- exception DoesNotExist
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned
Bases:
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 aForwardManyToOneDescriptor
instance.
- product_id
- translations
Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Parent.children
is aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- 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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- class shuup.core.models.ProductVariationVariableValue(id, ordering, variable, identifier)
Bases:
TranslatableModel
,SortableMixin
- exception DoesNotExist
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned
Bases:
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 aReverseManyToOneDescriptor
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 aForwardManyToOneDescriptor
instance.
- variable_id
- class shuup.core.models.ProductVisibility(value)
Bases:
Enum
- VISIBLE_TO_ALL = 1
- VISIBLE_TO_LOGGED_IN = 2
- VISIBLE_TO_GROUPS = 3
- class shuup.core.models.RoundingMode(value)
Bases:
Enum
- ROUND_HALF_UP = 'ROUND_HALF_UP'
- ROUND_HALF_DOWN = 'ROUND_HALF_DOWN'
- ROUND_UP = 'ROUND_UP'
- ROUND_DOWN = 'ROUND_DOWN'
- class shuup.core.models.SalesUnit(id, identifier, decimals)
Bases:
_ShortNameToSymbol
,TranslatableShuupModel
- exception DoesNotExist
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned
Bases:
MultipleObjectsReturned
- property 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.
- property 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:
- 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 aReverseManyToOneDescriptor
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 aReverseManyToOneDescriptor
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:
- 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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- class shuup.core.models.SavedAddress(*args, **kwargs)
Bases:
ShuupModel
Model for saving multiple addresses in an ‘address book’ of sorts.
- exception DoesNotExist
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned
Bases:
MultipleObjectsReturned
- add_log_entry(message, identifier=None, kind=LogEntryKind.OTHER, 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 aForwardManyToOneDescriptor
instance.
- address_id
- 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 displayingSavedAddress
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 aReverseManyToOneDescriptor
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 aForwardManyToOneDescriptor
instance.
- owner_id
- role
- status
- 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.Service(*args, **kwargs)
Bases:
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 theServiceChoice.identifier
values returned by theServiceProvider.get_service_choices
method.- 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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- 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: OrderSource) Iterable[ServiceCost] [source]
Get costs of this service for items in a given source.
- Returns:
description, price and tax class of the costs.
- 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:
- 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: OrderSource) PriceInfo [source]
Get total cost of this service for items in a given source.
Get reasons of being unavailable for a given source or order.
- 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: OrderSource | Order) bool [source]
Return true if service is available for a given source or order.
- 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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- logo
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
- logo_id
- name
Descriptor for translated attributes.
This attribute proxies all get/set calls to the translated model.
- objects
- old_module_data
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- 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.
- property provider
shuup.core.models.ServiceProvider
- Type:
rtype
- shop
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
- shop_id
- supplier
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
- supplier_id
- 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 aForwardManyToOneDescriptor
instance.
- tax_class_id
- class shuup.core.models.ServiceBehaviorComponent(id, polymorphic_ctype, identifier)
Bases:
PolymorphicShuupModel
Replace Django’s inheritance accessor member functions for our model (self.__class__) with our own versions. We monkey patch them until a patch can be added to Django (which would probably be very small and make all of this obsolete).
If we have inheritance of the form ModelA -> ModelB ->ModelC then Django creates accessors like this: - ModelA: modelb - ModelB: modela_ptr, modelb, modelc - ModelC: modela_ptr, modelb, modelb_ptr, modelc
These accessors allow Django (and everyone else) to travel up and down the inheritance tree for the db object at hand.
The original Django accessors use our polymorphic manager. But they should not. So we replace them with our own accessors that use our appropriate base_objects manager.
- exception DoesNotExist
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned
Bases:
MultipleObjectsReturned
- __init__(*args, **kwargs)[source]
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.
- 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 aReverseOneToOneDescriptor
instance.
- expensiveswedenbehaviorcomponent
Accessor to the related object on the reverse side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Place.restaurant
is aReverseOneToOneDescriptor
instance.
- 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 aReverseOneToOneDescriptor
instance.
- get_costs(service: Service, source: OrderSource)[source]
Return costs for this object. This should be implemented in a subclass. This method is used to calculate price for
ShippingMethod
andPaymentMethod
objects.
- get_delivery_time(service: Service, source: OrderSource)[source]
- Return type:
shuup.utils.dates.DurationRange|None
- 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 aReverseOneToOneDescriptor
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 aReverseOneToOneDescriptor
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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- polymorphic_ctype
The model field that stores the
ContentType
reference to the actual class.
- 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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- 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 aReverseOneToOneDescriptor
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 aReverseOneToOneDescriptor
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 aReverseOneToOneDescriptor
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 aReverseOneToOneDescriptor
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.
- __init__(identifier, name)[source]
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.- __init__(price, description=None, tax_class=None, base_price=None)[source]
Initialize cost from values.
Note: If
tax_class
is specified,description
must also be given.
- property price_info
- class shuup.core.models.ServiceProvider(*args, **kwargs)
Bases:
PolymorphicTranslatableShuupModel
Entity that provides services.
Good examples of service providers are
Carrier
andPaymentProcessor
.When subclassing
ServiceProvider
, set value forservice_model
class attribute. It should be a model class, which is a subclass ofService
.Replace Django’s inheritance accessor member functions for our model (self.__class__) with our own versions. We monkey patch them until a patch can be added to Django (which would probably be very small and make all of this obsolete).
If we have inheritance of the form ModelA -> ModelB ->ModelC then Django creates accessors like this: - ModelA: modelb - ModelB: modela_ptr, modelb, modelc - ModelC: modela_ptr, modelb, modelb_ptr, modelc
These accessors allow Django (and everyone else) to travel up and down the inheritance tree for the db object at hand.
The original Django accessors use our polymorphic manager. But they should not. So we replace them with our own accessors that use our appropriate base_objects manager.
- exception DoesNotExist
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned
Bases:
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 aReverseManyToOneDescriptor
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 aReverseOneToOneDescriptor
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 resolvedchoice_identifier
.- Parameters:
choice_identifier (str|None) – Identifier of the service choice to use. If None, use the default service choice.
- Return type:
- 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:
- get_service_choices()[source]
Get all service choices of this provider.
Subclasses should implement this method.
- Return 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.
- logo
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
- logo_id
- 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 aReverseOneToOneDescriptor
instance.
- polymorphic_ctype
The model field that stores the
ContentType
reference to the actual class.
- 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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- supplier
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
- supplier_id
- class shuup.core.models.Shipment(id, order, supplier, created_on, status, tracking_code, tracking_url, description, volume, weight, identifier, type)
Bases:
ShuupModel
- exception DoesNotExist
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned
Bases:
MultipleObjectsReturned
- add_log_entry(message, identifier=None, kind=LogEntryKind.OTHER, user=None, extra=None, save=True)
- cache_values()[source]
(Re)cache
volume
andweight
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.
- 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.
- log_entries
Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Parent.children
is aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- 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 aForwardManyToOneDescriptor
instance.
- order_id
- products
Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Parent.children
is aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- save(*args, **kwargs)[source]
Save the current instance. Override this in a subclass if you want to control the saving process.
The ‘force_insert’ and ‘force_update’ parameters can be used to insist that the “save” must be an SQL insert or update (or equivalent for non-SQL backends), respectively. Normally, they should not be set.
- 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
- status
- supplier
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
- supplier_id
- property 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
- 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:
ShuupModel
- exception DoesNotExist
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned
Bases:
MultipleObjectsReturned
- add_log_entry(message, identifier=None, kind=LogEntryKind.OTHER, user=None, extra=None, save=True)
- id
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- log_entries
Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Parent.children
is aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- 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 aForwardManyToOneDescriptor
instance.
- product_id
- 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 aForwardManyToOneDescriptor
instance.
- shipment_id
- 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(value)
Bases:
Enum
- NOT_SENT = 0
- SENT = 1
- RECEIVED = 2
- ERROR = 10
- DELETED = 20
- class shuup.core.models.ShippingMethod(id, identifier, enabled, shop, supplier, choice_identifier, old_module_identifier, old_module_data, logo, tax_class, carrier)
Bases:
Service
- exception DoesNotExist
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned
Bases:
MultipleObjectsReturned
- add_log_entry(message, identifier=None, kind=LogEntryKind.OTHER, 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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- 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 aForwardManyToOneDescriptor
instance.
- carrier_id
- 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 aReverseManyToOneDescriptor
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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- 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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- logo
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
- name
Descriptor for translated attributes.
This attribute proxies all get/set calls to the translated 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 aReverseManyToOneDescriptor
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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- shop
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
- shop_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 aForwardManyToOneDescriptor
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 aForwardManyToOneDescriptor
instance.
- translations
Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Parent.children
is aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- class shuup.core.models.ShippingStatus(value)
Bases:
Enum
- NOT_SHIPPED = 0
- PARTIALLY_SHIPPED = 1
- FULLY_SHIPPED = 2
- class shuup.core.models.ShuupModel(*args, **kwargs)
Bases:
Model
Shuup Model.
- 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:
ChangeProtected
,TranslatableShuupModel
- exception DoesNotExist
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned
Bases:
MultipleObjectsReturned
- add_log_entry(message, identifier=None, kind=LogEntryKind.OTHER, user=None, extra=None, save=True)
- admin_fonts
Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Parent.children
is aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- admin_theme_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 aReverseOneToOneDescriptor
instance.
- 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 aReverseManyToOneDescriptor
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 aReverseManyToOneDescriptor
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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- campaign_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 aReverseManyToOneDescriptor
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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- catalog_discounted_prices
Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Parent.children
is aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- catalog_prices
Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Parent.children
is aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- 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 aReverseManyToOneDescriptor
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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- 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 aReverseManyToOneDescriptor
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 aReverseManyToOneDescriptor
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 aForwardManyToOneDescriptor
instance.
- contact_address_id
- 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 aReverseManyToOneDescriptor
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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- create_price(value)[source]
Create a price with given value and settings of this shop.
Takes the
prices_include_tax
andcurrency
settings of this Shop into account.- Return type:
- 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.
- 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 aForwardManyToOneDescriptor
instance.
- favicon_id
- 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 aReverseManyToOneDescriptor
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 aReverseManyToOneDescriptor
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 aReverseOneToOneDescriptor
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 reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Parent.children
is aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- 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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- log_entries
Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Parent.children
is aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- logo
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
- logo_id
- 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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- 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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- 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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- 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 aReverseManyToOneDescriptor
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 wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- 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 aReverseManyToOneDescriptor
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 aForwardManyToOneDescriptor
instance.
- owner_id
- 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 aReverseManyToOneDescriptor
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 aReverseManyToOneDescriptor
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 aReverseManyToOneDescriptor
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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- 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 aReverseManyToOneDescriptor
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 aReverseManyToOneDescriptor
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 aReverseManyToOneDescriptor
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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- 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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- shop_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 aReverseManyToOneDescriptor
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 aReverseManyToOneDescriptor
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 aReverseManyToOneDescriptor
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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- status
- 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 aReverseManyToOneDescriptor
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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- supplierprice_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 aReverseManyToOneDescriptor
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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- 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 aReverseManyToOneDescriptor
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 aReverseManyToOneDescriptor
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 aReverseManyToOneDescriptor
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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- class shuup.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:
MoneyPropped
,TranslatableModel
- exception DoesNotExist
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned
Bases:
MultipleObjectsReturned
- add_log_entry(message, identifier=None, kind=LogEntryKind.OTHER, 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 aReverseManyToOneDescriptor
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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- clean()[source]
Hook for doing any extra model-wide validation after clean() has been called on every field by self.clean_fields. Any ValidationError raised by this method will not be associated with a particular field; it will have a special-case association with the field defined by NON_FIELD_ERRORS.
- default_price
Property for Price object.
Similar to
MoneyProperty
, but also hasincludes_tax
field.Operaters with
TaxfulPrice
andTaxlessPrice
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.
- discounts_link
Accessor to the related object on the reverse side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Place.restaurant
is aReverseOneToOneDescriptor
instance.
- property display_quantity_minimum
Quantity minimum of this shop product in the display unit.
Note: This can never be smaller than the display precision.
- property 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 aForwardManyToOneDescriptor
instance.
- display_unit_id
- 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.
customer (shuup.core.models.Contact) – Customer contact.
ignore_minimum (bool) – Ignore any limitations caused by quantity minimums.
- Returns:
Iterable[ValidationError]
- 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.
customer (shuup.core.models.Contact) – Customer contact.
ignore_minimum (bool) – Ignore any limitations caused by quantity minimums.
- Returns:
Iterable[ValidationError]
- get_visibility_display(*, field=<enumfields.fields.EnumIntegerField: visibility>)
- 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.
- property 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:
- is_orderable(supplier, customer, quantity, allow_cache=True)[source]
Product to be orderable it needs to be visible and purchasable.
- 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.
- property 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 aReverseManyToOneDescriptor
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 hasincludes_tax
field.Operaters with
TaxfulPrice
andTaxlessPrice
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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- 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 aForwardManyToOneDescriptor
instance.
- primary_category_id
- property 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 aForwardManyToOneDescriptor
instance.
- product_id
- property public_images
- property 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.
- property quantity_step
Quantity step for purchasing this product.
- Return type:
Example
<input type=”number” step=”{{ shop_product.quantity_step }}”>
- property rounded_minimum_purchase_quantity
The minimum purchase quantity, rounded to the sales unit’s precision.
- Return type:
Example
- <input type=”number”
min=”{{ shop_product.rounded_minimum_purchase_quantity }}” value=”{{ shop_product.rounded_minimum_purchase_quantity }}”>
- save(*args, **kwargs)[source]
Save the current instance. Override this in a subclass if you want to control the saving process.
The ‘force_insert’ and ‘force_update’ parameters can be used to insist that the “save” must be an SQL insert or update (or equivalent for non-SQL backends), respectively. Normally, they should not be set.
- property 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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- shop
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
- shop_id
- 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 aForwardManyToOneDescriptor
instance.
- shop_primary_image_id
- 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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- translations
Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Parent.children
is aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- ultrafilter4
Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.
In the example:
class Pizza(Model): toppings = ManyToManyField(Topping, related_name='pizzas')
Pizza.toppings
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- ultrafilter_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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- property unit
Unit of this product.
- Return type:
- validators = <module 'shuup.core.validators' from '/home/runner/work/shuup/shuup/shuup/core/validators.py'>
- visibility
- 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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- visibility_limit
- property visible
- class shuup.core.models.ShopProductVisibility(value)
Bases:
Enum
- NOT_VISIBLE = 0
- SEARCHABLE = 1
- LISTED = 2
- ALWAYS_VISIBLE = 3
- class shuup.core.models.StaffOnlyBehaviorComponent(id, polymorphic_ctype, identifier, servicebehaviorcomponent_ptr)
Bases:
ServiceBehaviorComponent
Replace Django’s inheritance accessor member functions for our model (self.__class__) with our own versions. We monkey patch them until a patch can be added to Django (which would probably be very small and make all of this obsolete).
If we have inheritance of the form ModelA -> ModelB ->ModelC then Django creates accessors like this: - ModelA: modelb - ModelB: modela_ptr, modelb, modelc - ModelC: modela_ptr, modelb, modelb_ptr, modelc
These accessors allow Django (and everyone else) to travel up and down the inheritance tree for the db object at hand.
The original Django accessors use our polymorphic manager. But they should not. So we replace them with our own accessors that use our appropriate base_objects manager.
- exception DoesNotExist
Bases:
DoesNotExist
- exception MultipleObjectsReturned
Bases:
MultipleObjectsReturned
- 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 aForwardOneToOneDescriptor
instance.
- servicebehaviorcomponent_ptr_id
- class shuup.core.models.SuppliedProduct(id, supplier, product, sku, alert_limit, physical_count, logical_count)
Bases:
Model
- exception DoesNotExist
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned
Bases:
MultipleObjectsReturned
- add_log_entry(message, identifier=None, kind=LogEntryKind.OTHER, 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 aReverseManyToOneDescriptor
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 aForwardManyToOneDescriptor
instance.
- product_id
- 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 aForwardManyToOneDescriptor
instance.
- supplier_id
- 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:
ModuleInterface
,TranslatableShuupModel
- exception DoesNotExist
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned
Bases:
MultipleObjectsReturned
- add_log_entry(message, identifier=None, kind=LogEntryKind.OTHER, user=None, extra=None, save=True)
- 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 aReverseManyToOneDescriptor
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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- campaign_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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- catalog_discounted_prices
Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Parent.children
is aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- catalog_prices
Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Parent.children
is aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- 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 aForwardManyToOneDescriptor
instance.
- contact_address_id
- 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:
shop_product (shuup.core.models.ShopProduct) – Shop Product.
quantity (decimal.Decimal) – Quantity to order.
contect (shuup.core.models.Contact) – Ordering contact.
- 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_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:
- get_suppliable_products(shop, customer)[source]
- Parameters:
shop (shuup.core.models.Shop) – Shop to check for suppliability.
customer (shuup.core.models.Contact) – Customer contact to check for suppliability.
- Return type:
- 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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- logo
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
- logo_id
- 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 wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- 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 wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- 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 aReverseManyToOneDescriptor
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 aReverseManyToOneDescriptor
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 aReverseManyToOneDescriptor
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]
Save the current instance. Override this in a subclass if you want to control the saving process.
The ‘force_insert’ and ‘force_update’ parameters can be used to insist that the “save” must be an SQL insert or update (or equivalent for non-SQL backends), respectively. Normally, they should not be set.
- 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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- 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 aReverseManyToOneDescriptor
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 aReverseManyToOneDescriptor
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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- 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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- slug
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- 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 aReverseManyToOneDescriptor
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 aReverseManyToOneDescriptor
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 aReverseManyToOneDescriptor
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 aReverseManyToOneDescriptor
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 aReverseManyToOneDescriptor
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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- 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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- supplierprice_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 aReverseManyToOneDescriptor
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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- type
- class shuup.core.models.SupplierShop(id, supplier, shop, is_approved)
Bases:
Model
- exception DoesNotExist
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned
Bases:
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 aForwardManyToOneDescriptor
instance.
- shop_id
- supplier
Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parent
is aForwardManyToOneDescriptor
instance.
- supplier_id
- class shuup.core.models.SupplierModule(id, module_identifier, name)
Bases:
Model
- exception DoesNotExist
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned
Bases:
MultipleObjectsReturned
- 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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- class shuup.core.models.Tax(id, code, rate, amount_value, currency, enabled)
Bases:
MoneyPropped
,ChangeProtected
,TranslatableShuupModel
- exception DoesNotExist
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned
Bases:
MultipleObjectsReturned
- add_log_entry(message, identifier=None, kind=LogEntryKind.OTHER, user=None, extra=None, save=True)
- amount
Property for a Money amount.
Will return
Money
objects when the property is being get and acceptsMoney
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 toinstance.foo.bar
whereinstance
is an instance of the class owning theMoneyProperty
.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 anUnitMixupError
.
- 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:
- change_protect_message = "Can't change the business critical fields of the Tax that is in use."
- clean()[source]
Hook for doing any extra model-wide validation after clean() has been called on every field by self.clean_fields. Any ValidationError raised by this method will not be associated with a particular field; it will have a special-case association with the field defined by NON_FIELD_ERRORS.
- 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 aReverseManyToOneDescriptor
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 aReverseManyToOneDescriptor
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 aReverseManyToOneDescriptor
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 aReverseManyToOneDescriptor
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:
TranslatableShuupModel
- exception DoesNotExist
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned
Bases:
MultipleObjectsReturned
- add_log_entry(message, identifier=None, kind=LogEntryKind.OTHER, 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 aReverseManyToOneDescriptor
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 aReverseManyToOneDescriptor
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 aReverseManyToOneDescriptor
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 aReverseManyToOneDescriptor
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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- translations
Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Parent.children
is aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- class shuup.core.models.TranslatableShuupModel(*args, **kwargs)
Bases:
ShuupModel
,TranslatableModel
- 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.
- property comparison_quantity
Quantity (in internal units) to use as the unit in unit prices.
- Return type:
- Returns:
Quantity, in internal unit.
- property 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.
- 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)
- get_symbol(allow_empty=True)[source]
Returns symbol of the display unit or empty if it is not needed.
- Return type:
- 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.
- class shuup.core.models.WaivingCostBehaviorComponent(id, polymorphic_ctype, identifier, servicebehaviorcomponent_ptr, price_value, waive_limit_value)
Bases:
TranslatableServiceBehaviorComponent
Replace Django’s inheritance accessor member functions for our model (self.__class__) with our own versions. We monkey patch them until a patch can be added to Django (which would probably be very small and make all of this obsolete).
If we have inheritance of the form ModelA -> ModelB ->ModelC then Django creates accessors like this: - ModelA: modelb - ModelB: modela_ptr, modelb, modelc - ModelC: modela_ptr, modelb, modelb_ptr, modelc
These accessors allow Django (and everyone else) to travel up and down the inheritance tree for the db object at hand.
The original Django accessors use our polymorphic manager. But they should not. So we replace them with our own accessors that use our appropriate base_objects manager.
- exception DoesNotExist
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned
Bases:
MultipleObjectsReturned
- description
Descriptor for translated attributes.
This attribute proxies all get/set calls to the translated model.
- 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
andPaymentMethod
objects.
- 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 aForwardOneToOneDescriptor
instance.
- translations
Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Parent.children
is aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- 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:
TranslatableModel
- exception DoesNotExist
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned
Bases:
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 aForwardManyToOneDescriptor
instance.
- component_id
- 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.
- 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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- class shuup.core.models.WeightBasedPricingBehaviorComponent(id, polymorphic_ctype, identifier, servicebehaviorcomponent_ptr)
Bases:
ServiceBehaviorComponent
Replace Django’s inheritance accessor member functions for our model (self.__class__) with our own versions. We monkey patch them until a patch can be added to Django (which would probably be very small and make all of this obsolete).
If we have inheritance of the form ModelA -> ModelB ->ModelC then Django creates accessors like this: - ModelA: modelb - ModelB: modela_ptr, modelb, modelc - ModelC: modela_ptr, modelb, modelb_ptr, modelc
These accessors allow Django (and everyone else) to travel up and down the inheritance tree for the db object at hand.
The original Django accessors use our polymorphic manager. But they should not. So we replace them with our own accessors that use our appropriate base_objects manager.
- exception DoesNotExist
Bases:
DoesNotExist
- exception MultipleObjectsReturned
Bases:
MultipleObjectsReturned
- 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
andPaymentMethod
objects.
- 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 aReverseManyToOneDescriptor
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 aForwardOneToOneDescriptor
instance.
- servicebehaviorcomponent_ptr_id
- class shuup.core.models.WeightLimitsBehaviorComponent(id, polymorphic_ctype, identifier, servicebehaviorcomponent_ptr, min_weight, max_weight)
Bases:
ServiceBehaviorComponent
Replace Django’s inheritance accessor member functions for our model (self.__class__) with our own versions. We monkey patch them until a patch can be added to Django (which would probably be very small and make all of this obsolete).
If we have inheritance of the form ModelA -> ModelB ->ModelC then Django creates accessors like this: - ModelA: modelb - ModelB: modela_ptr, modelb, modelc - ModelC: modela_ptr, modelb, modelb_ptr, modelc
These accessors allow Django (and everyone else) to travel up and down the inheritance tree for the db object at hand.
The original Django accessors use our polymorphic manager. But they should not. So we replace them with our own accessors that use our appropriate base_objects manager.
- exception DoesNotExist
Bases:
DoesNotExist
- exception MultipleObjectsReturned
Bases:
MultipleObjectsReturned
- 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 aForwardOneToOneDescriptor
instance.
- servicebehaviorcomponent_ptr_id