shuup.customer_group_pricing package
Submodules
shuup.customer_group_pricing.admin_form_part module
- class shuup.customer_group_pricing.admin_form_part.CustomerGroupPricingForm(**kwargs)[source]
Bases:
Form
- base_fields = {}
- declared_fields = {}
- property media
Return all media required to render the widgets on this form.
- class shuup.customer_group_pricing.admin_form_part.CustomerGroupDiscountForm(**kwargs)[source]
Bases:
Form
- base_fields = {}
- declared_fields = {}
- property media
Return all media required to render the widgets on this form.
shuup.customer_group_pricing.models module
- class shuup.customer_group_pricing.models.CgpBase(*args, **kwargs)[source]
Bases:
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.
- 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.
- 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.
- class Meta[source]
Bases:
object
- abstract = False
- unique_together = (('product', 'shop', 'group'),)
- group_id
- product_id
- shop_id
- class shuup.customer_group_pricing.models.CgpPrice(id, product, shop, group, price_value)[source]
Bases:
MoneyPropped
,CgpBase
- 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.
- 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.
- 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.
- 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.
- 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.
- class shuup.customer_group_pricing.models.CgpDiscount(id, product, shop, group, discount_amount_value)[source]
Bases:
MoneyPropped
,CgpBase
- 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.
- 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.
- 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.
- 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.
- 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.
shuup.customer_group_pricing.module module
- class shuup.customer_group_pricing.module.CustomerGroupPricingModule[source]
Bases:
PricingModule
- identifier = 'customer_group_pricing'
- name = 'Customer Group Pricing'
- get_price_info(context, product, quantity=1)[source]
Get price info for a given quantity of the product.
- Parameters:
product (shuup.core.models.Product|int) –
Product
object or id ofProduct
.- Return type:
- index_shop_product(shop_product: ShopProduct | int, **kwargs)[source]
Index the prices for the given shop product
- class shuup.customer_group_pricing.module.CustomerGroupDiscountModule[source]
Bases:
DiscountModule
- identifier = 'customer_group_discount'
- name = 'Customer Group Discount'
- index_shop_product(shop_product: ShopProduct | int, **kwargs)[source]
Index the shop product discounts
shuup.customer_group_pricing.signal_handers module
- shuup.customer_group_pricing.signal_handers.handle_cgp_discount_post_save(sender, instance, **kwargs)[source]
- shuup.customer_group_pricing.signal_handers.handle_cgp_price_post_save(sender, instance, **kwargs)[source]
Module contents
- class shuup.customer_group_pricing.CustomerGroupPricingAppConfig(*args, **kwargs)[source]
Bases:
AppConfig
- name = 'shuup.customer_group_pricing'
- verbose_name = 'Shuup Customer Group Pricing'
- label = 'shuup_customer_group_pricing'
- default_auto_field = 'django.db.models.BigAutoField'
- provides = {'admin_product_form_part': ['shuup.customer_group_pricing.admin_form_part:CustomerGroupPricingFormPart', 'shuup.customer_group_pricing.admin_form_part:CustomerGroupPricingDiscountFormPart'], 'discount_module': ['shuup.customer_group_pricing.module:CustomerGroupDiscountModule'], 'pricing_module': ['shuup.customer_group_pricing.module:CustomerGroupPricingModule']}
See /provides for details about the
provides
variable.