shoop.core.models package

Module contents

class shoop.core.models.AnonymousContact(id, polymorphic_ctype, created_on, identifier, is_active, default_shipping_address, default_billing_address, default_shipping_method, default_payment_method, language, marketing_permission, phone, www, timezone, prefix, name, suffix, name_ext, email, tax_group, contact_ptr)

Bases: shoop.core.models.Contact

exception DoesNotExist

Bases: shoop.core.models._contacts.DoesNotExist

exception AnonymousContact.MultipleObjectsReturned

Bases: shoop.core.models._contacts.MultipleObjectsReturned

AnonymousContact.base_objects = <django.db.models.manager.Manager object>
AnonymousContact.contact_ptr
AnonymousContact.delete(*args, **kwargs)[source]
AnonymousContact.groups
AnonymousContact.id = None
AnonymousContact.is_anonymous = True
AnonymousContact.objects = <polymorphic.managers.PolymorphicManager object>
AnonymousContact.pk = None
AnonymousContact.polymorphic_primary_key_name = 'id'
AnonymousContact.polymorphic_super_sub_accessors_replaced = False
AnonymousContact.save(*args, **kwargs)[source]
class shoop.core.models.Attribute(id, identifier, searchable, type, visibility_mode)

Bases: parler.models.TranslatableModel

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception Attribute.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

Attribute.formfield(**kwargs)[source]

Get a form field for this attribute.

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

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

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

Descriptor for translated attributes.

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

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

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

Attribute.visibility_mode

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

class shoop.core.models.AttributeType

Bases: enumfields.enums.Enum

class shoop.core.models.AttributeVisibility

Bases: enumfields.enums.Enum

class shoop.core.models.Category(id, parent, identifier, status, image, ordering, visibility)

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

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception Category.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

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

Descriptor for translated attributes.

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

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

Descriptor for translated attributes.

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

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

Descriptor for translated attributes.

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

Category.status

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

Category.translations
Category.visibility

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

Category.visibility_groups
class shoop.core.models.CategoryStatus

Bases: enumfields.enums.Enum

class shoop.core.models.CategoryVisibility

Bases: enumfields.enums.Enum

class shoop.core.models.CompanyContact(id, polymorphic_ctype, created_on, identifier, is_active, default_shipping_address, default_billing_address, default_shipping_method, default_payment_method, language, marketing_permission, phone, www, timezone, prefix, name, suffix, name_ext, email, tax_group, contact_ptr, tax_number)

Bases: shoop.core.models.Contact

exception DoesNotExist

Bases: shoop.core.models._contacts.DoesNotExist

exception CompanyContact.MultipleObjectsReturned

Bases: shoop.core.models._contacts.MultipleObjectsReturned

CompanyContact.base_objects = <django.db.models.manager.Manager object>
CompanyContact.contact_ptr
CompanyContact.default_tax_group_getter()
CompanyContact.members
CompanyContact.objects = <polymorphic.managers.PolymorphicManager object>
CompanyContact.polymorphic_primary_key_name = 'id'
CompanyContact.polymorphic_super_sub_accessors_replaced = False
class shoop.core.models.ConfigurationItem(id, shop, key, value)

Bases: shoop.core.models._base.ShoopModel

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception ConfigurationItem.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

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

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

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

Bases: shoop.core.utils.name_mixin.NameMixin, polymorphic.models.PolymorphicModel

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception Contact.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

Contact.anonymouscontact
Contact.base_objects = <django.db.models.manager.Manager object>
Contact.company_memberships
Contact.companycontact
Contact.customer_baskets
Contact.customer_orders
Contact.default_billing_address
Contact.default_payment_method
Contact.default_shipping_address
Contact.default_shipping_method
Contact.default_tax_group_getter = None
Contact.get_language_display(*moreargs, **morekwargs)
Contact.get_next_by_created_on(*moreargs, **morekwargs)
Contact.get_previous_by_created_on(*moreargs, **morekwargs)
Contact.get_timezone_display(*moreargs, **morekwargs)
Contact.groups
Contact.is_all_seeing = False
Contact.is_anonymous = False
Contact.objects = <polymorphic.managers.PolymorphicManager object>
Contact.personcontact
Contact.polymorphic_ctype
Contact.polymorphic_primary_key_name = 'id'
Contact.polymorphic_super_sub_accessors_replaced = False
Contact.savedaddress_set
Contact.shop_set
Contact.tax_group
Contact.timezone

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

class shoop.core.models.ContactGroup(id, identifier, show_pricing)

Bases: parler.models.TranslatableModel

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception ContactGroup.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

ContactGroup.members
ContactGroup.name

Descriptor for translated attributes.

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

ContactGroup.objects = <parler.managers.TranslatableManager object>
ContactGroup.simpleproductprice_set
ContactGroup.translations
ContactGroup.visible_categories
ContactGroup.visible_products
class shoop.core.models.Counter(id, value)

Bases: django.db.models.base.Model

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception Counter.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

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

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

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

Bases: enumfields.enums.Enum

class shoop.core.models.CustomerTaxGroup(id, identifier, enabled)

Bases: shoop.core.models._base.TranslatableShoopModel

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception CustomerTaxGroup.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

CustomerTaxGroup.contact_set
classmethod CustomerTaxGroup.get_default_company_group()[source]
classmethod CustomerTaxGroup.get_default_person_group()[source]
CustomerTaxGroup.name

Descriptor for translated attributes.

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

CustomerTaxGroup.objects = <parler.managers.TranslatableManager object>
CustomerTaxGroup.taxrule_set
CustomerTaxGroup.translations
shoop.core.models.get_person_contact(user)

Get PersonContact of given user.

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

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

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

Bases: enumfields.enums.Enum

class shoop.core.models.ImmutableAddress(*args, **kwargs)

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

An address that can not be changed.

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

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

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception ImmutableAddress.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

ImmutableAddress.billing_orders
ImmutableAddress.country

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

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

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

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

Get or create immutable address with given data.

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

Bases: django.db.models.base.Model

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception Manufacturer.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

Manufacturer.get_next_by_created_on(*moreargs, **morekwargs)
Manufacturer.get_previous_by_created_on(*moreargs, **morekwargs)
Manufacturer.objects = <django.db.models.manager.Manager object>
Manufacturer.product_set
class shoop.core.models.MethodStatus

Bases: enumfields.enums.Enum

class shoop.core.models.MethodType

Bases: enumfields.enums.Enum

class shoop.core.models.MutableAddress(*args, **kwargs)

Bases: shoop.core.models._addresses.Address

An address that can be changed.

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

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

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MutableAddress.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

MutableAddress.country

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

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

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

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

Construct mutable address from a data dictionary.

Parameters:data (dict[str,str]) – data for address
Returns:Unsaved mutable address
Return type:MutableAddress
MutableAddress.get_country_display(*moreargs, **morekwargs)
MutableAddress.objects = <django.db.models.manager.Manager object>
MutableAddress.saved_addresses
class shoop.core.models.Order(id, shop, created_on, identifier, label, key, reference_number, customer, orderer, billing_address, shipping_address, tax_number, phone, email, creator, 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)

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

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception Order.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

Order.add_log_entry(message, identifier=None, kind=<LogEntryKind.OTHER: 0>, user=None, extra=None, save=True)
Order.billing_address
Order.cache_prices()[source]
Order.can_set_complete()[source]
Order.check_all_verified()[source]
Order.check_and_set_fully_shipped()[source]
Order.create_payment(amount, payment_identifier=None, description='')[source]

Create a payment with given amount for this order.

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

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

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

The created Payment object

Return type:

shoop.core.models.Payment

Order.create_shipment(supplier, product_quantities)[source]

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

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

Parameters:
  • supplier – The Supplier for this product. No validation is made as to whether the given supplier supplies the products.
  • product_quantities (dict[shoop.shop.models.Product, decimal.Decimal]) – a dict mapping Product instances to quantities to ship
Raises:

NoProductsToShipException

Returns:

Saved, complete Shipment object

Return type:

shoop.core.models.Shipment

Order.create_shipment_of_all_products(supplier=None)[source]

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

See the documentation for create_shipment.

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

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

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

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

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

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

Order.get_purchased_attachments()[source]
Order.get_shipping_status_display(*moreargs, **morekwargs)
Order.get_status_display()[source]
Order.get_tax_summary()[source]
Return type:taxing.TaxSummary
Order.get_total_paid_amount()[source]
Order.get_unshipped_products()[source]
Order.is_complete()[source]
Order.is_paid()[source]
Order.lines
Order.log_entries
Order.objects = <django.db.models.manager.ManagerFromOrderQuerySet object>
Order.orderer
Order.payment_data

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

Order.payment_method
Order.payment_status

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

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

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

Order.shipping_method
Order.shipping_status

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

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

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

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception OrderLine.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

OrderLine.base_unit_price

Property for Price object.

Similar to MoneyProperty but also has includes_tax field.

Operaters with TaxfulPrice and TaxlessPrice objects.

OrderLine.child_lines
OrderLine.discount_amount

Property for Price object.

Similar to MoneyProperty but also has includes_tax field.

Operaters with TaxfulPrice and TaxlessPrice objects.

OrderLine.extra_data

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

OrderLine.get_type_display(*moreargs, **morekwargs)
OrderLine.objects = <shoop.core.models._order_lines.OrderLineManager object>
OrderLine.order
OrderLine.parent_line
OrderLine.product
OrderLine.save(*args, **kwargs)[source]
OrderLine.supplier
OrderLine.tax_amount
Return type:shoop.utils.money.Money
OrderLine.taxes
OrderLine.type

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

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

Bases: shoop.utils.properties.MoneyPropped, shoop.core.models._base.ShoopModel, shoop.core.taxing.LineTax

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception OrderLineTax.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

OrderLineTax.amount

Property for a Money amount.

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

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

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

OrderLineTax.base_amount

Property for a Money amount.

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

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

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

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

Bases: enumfields.enums.Enum

class shoop.core.models.OrderLogEntry(id, created_on, user, message, identifier, kind, extra, target)

Bases: shoop.utils.analog.BaseLogEntry

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception OrderLogEntry.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

OrderLogEntry.extra

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

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

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

OrderLogEntry.logged_model

alias of Order

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

Bases: parler.models.TranslatableModel

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception OrderStatus.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

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

Descriptor for translated attributes.

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

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

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

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

Bases: enumfields.enums.Enum

class shoop.core.models.Payment(id, order, created_on, gateway_id, payment_identifier, amount_value, foreign_amount_value, foreign_currency, description)

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

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception Payment.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

Payment.amount

Property for a Money amount.

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

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

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

Payment.foreign_amount

Property for a Money amount.

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

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

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

Payment.get_next_by_created_on(*moreargs, **morekwargs)
Payment.get_previous_by_created_on(*moreargs, **morekwargs)
Payment.objects = <django.db.models.manager.Manager object>
Payment.order
class shoop.core.models.PaymentMethod(id, tax_class, status, identifier, module_identifier, module_data)

Bases: shoop.core.models._methods.Method

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception PaymentMethod.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

PaymentMethod.contact_set
PaymentMethod.default_module_spec = 'shoop.core.methods.default:DefaultPaymentMethodModule'
PaymentMethod.get_payment_process_response(order, urls)[source]
PaymentMethod.get_status_display(*moreargs, **morekwargs)
PaymentMethod.line_type = <OrderLineType.PAYMENT: 3>
PaymentMethod.module_data

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

PaymentMethod.module_provides_key = 'payment_method_module'
PaymentMethod.name

Descriptor for translated attributes.

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

PaymentMethod.objects = <django.db.models.manager.ManagerFromMethodQuerySet object>
PaymentMethod.payment_orders
PaymentMethod.payment_products
PaymentMethod.process_payment_return_request(order, request)[source]
PaymentMethod.shop_product_m2m = 'payment_methods'
PaymentMethod.status

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

PaymentMethod.tax_class
PaymentMethod.translations
PaymentMethod.type = <MethodType.PAYMENT: 2>
class shoop.core.models.PaymentStatus

Bases: enumfields.enums.Enum

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

Bases: django.db.models.base.Model

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception PersistentCacheEntry.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

PersistentCacheEntry.data

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

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

Bases: shoop.core.models.Contact

exception DoesNotExist

Bases: shoop.core.models._contacts.DoesNotExist

exception PersonContact.MultipleObjectsReturned

Bases: shoop.core.models._contacts.MultipleObjectsReturned

PersonContact.base_objects = <django.db.models.manager.Manager object>
PersonContact.contact_ptr
PersonContact.default_tax_group_getter()
PersonContact.gender

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

PersonContact.get_gender_display(*moreargs, **morekwargs)
PersonContact.is_all_seeing
PersonContact.objects = <polymorphic.managers.PolymorphicManager object>
PersonContact.orderer_baskets
PersonContact.orderer_orders
PersonContact.polymorphic_primary_key_name = 'id'
PersonContact.polymorphic_super_sub_accessors_replaced = False
PersonContact.save(*args, **kwargs)[source]
PersonContact.user
class shoop.core.models.Product(id, created_on, modified_on, deleted, mode, variation_parent, stock_behavior, shipping_mode, sales_unit, tax_class, type, sku, gtin, barcode, accounting_identifier, profit_center, cost_center, category, width, height, depth, net_weight, gross_weight, manufacturer, primary_image)

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

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception Product.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

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

Fully remove variation information.

Make this product a non-variation parent.

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

Descriptor for translated attributes.

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

Product.get_all_available_combinations()[source]

Generate all available combinations of variation variables.

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

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

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

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

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

Get base price of the product within given context.

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

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

Get the PriceInfo of the cheapest variation child

The attribute used for sorting is PriceInfo.price.

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

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

Get the prices for cheapest and the most expensive child

The attribute used for sorting is PriceInfo.price.

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

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

Get price of the product within given context.

Note

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

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

Get PriceInfo object for the product in given context.

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

Return type:shoop.core.pricing.PriceInfo
Product.get_public_media()[source]
Product.get_shipping_mode_display(*moreargs, **morekwargs)
Product.get_shop_instance(shop)[source]
Return type:shoop.core.models.ShopProduct
Product.get_stock_behavior_display(*moreargs, **morekwargs)
Product.get_variation_siblings()[source]
Product.is_package_child()[source]
Product.is_package_parent()[source]
Product.is_variation_child()[source]
Product.is_variation_parent()[source]
Product.keywords

Descriptor for translated attributes.

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

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

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

Product.name

Descriptor for translated attributes.

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

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

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

Product.shop_products
Product.simplify_variation()[source]

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

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

Descriptor for translated attributes.

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

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

Descriptor for translated attributes.

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

Product.stock_behavior

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

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

Descriptor for translated attributes.

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

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

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

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

Bases: django.core.exceptions.ObjectDoesNotExist

exception Product.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

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

Fully remove variation information.

Make this product a non-variation parent.

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

Descriptor for translated attributes.

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

Product.get_all_available_combinations()[source]

Generate all available combinations of variation variables.

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

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

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

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

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

Get base price of the product within given context.

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

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

Get the PriceInfo of the cheapest variation child

The attribute used for sorting is PriceInfo.price.

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

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

Get the prices for cheapest and the most expensive child

The attribute used for sorting is PriceInfo.price.

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

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

Get price of the product within given context.

Note

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

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

Get PriceInfo object for the product in given context.

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

Return type:shoop.core.pricing.PriceInfo
Product.get_public_media()[source]
Product.get_shipping_mode_display(*moreargs, **morekwargs)
Product.get_shop_instance(shop)[source]
Return type:shoop.core.models.ShopProduct
Product.get_stock_behavior_display(*moreargs, **morekwargs)
Product.get_variation_siblings()[source]
Product.is_package_child()[source]
Product.is_package_parent()[source]
Product.is_variation_child()[source]
Product.is_variation_parent()[source]
Product.keywords

Descriptor for translated attributes.

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

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

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

Product.name

Descriptor for translated attributes.

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

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

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

Product.shop_products
Product.simplify_variation()[source]

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

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

Descriptor for translated attributes.

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

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

Descriptor for translated attributes.

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

Product.stock_behavior

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

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

Descriptor for translated attributes.

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

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

Bases: shoop.core.models._attributes.AppliedAttribute

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception ProductAttribute.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

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

Descriptor for translated attributes.

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

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

Bases: django.db.models.base.Model

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception ProductCrossSell.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

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

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

class shoop.core.models.ProductCrossSellType

Bases: enumfields.enums.Enum

class shoop.core.models.ProductMedia(id, identifier, product, kind, file, external_url, ordering, enabled, public, purchased)

Bases: parler.models.TranslatableModel

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception ProductMedia.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

ProductMedia.description

Descriptor for translated attributes.

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

ProductMedia.easy_thumbnails_thumbnailer

Get Thumbnailer instance.

Will return None if file cannot be thumbnailed.

:rtype:easy_thumbnails.files.Thumbnailer|None

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

Get thumbnail for image

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

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

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

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

Descriptor for translated attributes.

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

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

Bases: enumfields.enums.Enum

class shoop.core.models.ProductMode

Bases: enumfields.enums.Enum

Bases: django.db.models.base.Model

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception ProductPackageLink.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

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

Bases: parler.models.TranslatableModel

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception ProductType.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

ProductType.attributes
ProductType.name

Descriptor for translated attributes.

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

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

Bases: enumfields.enums.Enum

class shoop.core.models.ProductVariationResult(id, product, combination_hash, result, status)

Bases: django.db.models.base.Model

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception ProductVariationResult.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

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

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

class shoop.core.models.ProductVariationVariable(id, product, identifier)

Bases: parler.models.TranslatableModel

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception ProductVariationVariable.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

ProductVariationVariable.name

Descriptor for translated attributes.

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

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

Bases: parler.models.TranslatableModel

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception ProductVariationVariableValue.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

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

Descriptor for translated attributes.

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

ProductVariationVariableValue.variable
class shoop.core.models.ProductVisibility

Bases: enumfields.enums.Enum

class shoop.core.models.SalesUnit(id, identifier, decimals)

Bases: parler.models.TranslatableModel

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception SalesUnit.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

SalesUnit.allow_fractions
SalesUnit.name

Descriptor for translated attributes.

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

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

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

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

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

Descriptor for translated attributes.

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

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

Bases: shoop.core.models._base.ShoopModel

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

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception SavedAddress.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

SavedAddress.address
SavedAddress.get_role_display(*moreargs, **morekwargs)
SavedAddress.get_status_display(*moreargs, **morekwargs)
SavedAddress.get_title()[source]

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

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

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

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

SavedAddress.status

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

class shoop.core.models.SavedAddressRole

Bases: enumfields.enums.Enum

class shoop.core.models.SavedAddressStatus

Bases: enumfields.enums.Enum

class shoop.core.models.Shipment(id, order, supplier, created_on, status, tracking_code, description, volume, weight)

Bases: django.db.models.base.Model

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception Shipment.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

Shipment.cache_values()[source]

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

Shipment.get_next_by_created_on(*moreargs, **morekwargs)
Shipment.get_previous_by_created_on(*moreargs, **morekwargs)
Shipment.get_status_display(*moreargs, **morekwargs)
Shipment.objects = <django.db.models.manager.Manager object>
Shipment.order
Shipment.products
Shipment.status

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

Shipment.supplier
Shipment.total_products
class shoop.core.models.ShipmentProduct(id, shipment, product, quantity, unit_volume, unit_weight)

Bases: django.db.models.base.Model

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception ShipmentProduct.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

ShipmentProduct.cache_values()[source]
ShipmentProduct.objects = <django.db.models.manager.Manager object>
ShipmentProduct.product
ShipmentProduct.shipment
class shoop.core.models.ShippingMethod(id, tax_class, status, identifier, module_identifier, module_data)

Bases: shoop.core.models._methods.Method

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception ShippingMethod.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

ShippingMethod.contact_set
ShippingMethod.default_module_spec = 'shoop.core.methods.default:DefaultShippingMethodModule'
ShippingMethod.get_status_display(*moreargs, **morekwargs)
ShippingMethod.line_type = <OrderLineType.SHIPPING: 2>
ShippingMethod.module_data

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

ShippingMethod.module_provides_key = 'shipping_method_module'
ShippingMethod.name

Descriptor for translated attributes.

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

ShippingMethod.objects = <django.db.models.manager.ManagerFromMethodQuerySet object>
ShippingMethod.shipping_orders
ShippingMethod.shipping_products
ShippingMethod.shop_product_m2m = 'shipping_methods'
ShippingMethod.status

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

ShippingMethod.tax_class
ShippingMethod.translations
ShippingMethod.type = <MethodType.SHIPPING: 1>
class shoop.core.models.ShippingMode

Bases: enumfields.enums.Enum

class shoop.core.models.ShippingStatus

Bases: enumfields.enums.Enum

class shoop.core.models.Shop(id, identifier, domain, status, owner, options, currency, prices_include_tax, logo, maintenance_mode)

Bases: shoop.core.models._base.ChangeProtected, shoop.core.models._base.TranslatableShoopModel

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception Shop.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

Shop.categories
Shop.change_protect_message = <django.utils.functional.lazy.<locals>.__proxy__ object>
Shop.create_price(value)[source]

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

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

Return type:shoop.core.pricing.Price
Shop.discountedproductprice_set
Shop.get_status_display(*moreargs, **morekwargs)
Shop.maintenance_message

Descriptor for translated attributes.

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

Shop.name

Descriptor for translated attributes.

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

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

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

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

Descriptor for translated attributes.

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

Shop.shop_products
Shop.simpleproductprice_set
Shop.status

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

Shop.storedbasket_set
Shop.translations
class shoop.core.models.ShopProduct(id, shop, product, visible, listed, purchasable, searchable, visibility_limit, purchase_multiple, minimum_purchase_quantity, limit_shipping_methods, limit_payment_methods, primary_category, shop_primary_image, default_price_value)

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

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception ShopProduct.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

ShopProduct.categories
ShopProduct.default_price

Property for Price object.

Similar to MoneyProperty but also has includes_tax field.

Operaters with TaxfulPrice and TaxlessPrice objects.

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

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

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

Iterable[ValidationError]

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

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

ShopProduct.is_orderable(supplier, customer, quantity)[source]
ShopProduct.objects = <django.db.models.manager.Manager object>
ShopProduct.payment_methods
ShopProduct.primary_category
ShopProduct.primary_image
ShopProduct.product
ShopProduct.quantity_step

Quantity step for purchasing this product.

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

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

Return type:decimal.Decimal
Example:
<input type=”number”
min=”{{ shop_product.rounded_minimum_purchase_quantity }}” value=”{{ shop_product.rounded_minimum_purchase_quantity }}”>
ShopProduct.shipping_methods
ShopProduct.shop
ShopProduct.shop_primary_image
ShopProduct.suppliers
ShopProduct.visibility_groups
ShopProduct.visibility_limit

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

class shoop.core.models.ShopStatus

Bases: enumfields.enums.Enum

class shoop.core.models.StockBehavior

Bases: enumfields.enums.Enum

class shoop.core.models.SuppliedProduct(id, supplier, product, sku, alert_limit, physical_count, logical_count)

Bases: django.db.models.base.Model

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception SuppliedProduct.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

SuppliedProduct.objects = <django.db.models.manager.Manager object>
SuppliedProduct.product
SuppliedProduct.supplier
class shoop.core.models.Supplier(id, identifier, name, type, stock_managed, module_identifier, module_data)

Bases: shoop.core.modules.interface.ModuleInterface, shoop.core.models._base.ShoopModel

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception Supplier.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

Supplier.adjust_stock(product_id, delta, created_by=None)[source]
Supplier.default_module_spec = 'shoop.core.suppliers:BaseSupplierModule'
Supplier.get_orderability_errors(shop_product, quantity, customer)[source]
Parameters:
Return type:

iterable[ValidationError]

Supplier.get_stock_status(product_id)[source]
Parameters:product_id (int) – Product ID
Return type:shoop.core.stocks.ProductStockStatus
Supplier.get_stock_statuses(product_ids)[source]
Parameters:product_ids – Iterable of product IDs
Returns:Dict of {product_id: ProductStockStatus}
Return type:dict[int, shoop.core.stocks.ProductStockStatus]
Supplier.get_type_display(*moreargs, **morekwargs)
Supplier.module_data

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

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

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

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

Bases: enumfields.enums.Enum

class shoop.core.models.Tax(id, code, rate, amount_value, currency, enabled)

Bases: shoop.utils.properties.MoneyPropped, shoop.core.models._base.ChangeProtected, shoop.core.models._base.TranslatableShoopModel

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception Tax.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

Tax.amount

Property for a Money amount.

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

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

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

Tax.calculate_amount(base_amount)[source]

Calculate tax amount with this tax for given base amount.

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

Descriptor for translated attributes.

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

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

Bases: shoop.core.models._base.TranslatableShoopModel

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception TaxClass.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

TaxClass.name

Descriptor for translated attributes.

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

TaxClass.objects = <parler.managers.TranslatableManager object>
TaxClass.paymentmethod_set
TaxClass.product_set
TaxClass.shippingmethod_set
TaxClass.taxrule_set
TaxClass.translations