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: django.forms.forms.Form

save()[source]
get_shop_group_field(shop, group)[source]
base_fields = OrderedDict()
declared_fields = OrderedDict()
media
class shuup.customer_group_pricing.admin_form_part.CustomerGroupDiscountForm(**kwargs)[source]

Bases: django.forms.forms.Form

save()[source]
get_shop_group_field(shop, group)[source]
base_fields = OrderedDict()
declared_fields = OrderedDict()
media
class shuup.customer_group_pricing.admin_form_part.CustomerGroupPricingFormPart(request, object=None)[source]

Bases: shuup.admin.form_part.FormPart

priority = 10
get_form_defs()[source]
form_valid(form)[source]
class shuup.customer_group_pricing.admin_form_part.CustomerGroupPricingDiscountFormPart(request, object=None)[source]

Bases: shuup.admin.form_part.FormPart

priority = 11
get_form_defs()[source]
form_valid(form)[source]

shuup.customer_group_pricing.models module

class shuup.customer_group_pricing.models.CgpBase(*args, **kwargs)[source]

Bases: django.db.models.base.Model

Parameters:
product

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

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

shop

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

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

group

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

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

class Meta[source]

Bases: object

abstract = False
unique_together = (('product', 'shop', 'group'),)
group_id

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

product_id

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

shop_id

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

class shuup.customer_group_pricing.models.CgpPrice(id, product, shop, group, price_value)[source]

Bases: shuup.utils.properties.MoneyPropped, shuup.customer_group_pricing.models.CgpBase

Parameters:
price

Property for Price object.

Similar to MoneyProperty, but also has includes_tax field.

Operaters with TaxfulPrice and TaxlessPrice 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]
exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

group

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

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

id

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

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

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

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

shop

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

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

class shuup.customer_group_pricing.models.CgpDiscount(id, product, shop, group, discount_amount_value)[source]

Bases: shuup.utils.properties.MoneyPropped, shuup.customer_group_pricing.models.CgpBase

Parameters:
discount_amount

Property for Price object.

Similar to MoneyProperty, but also has includes_tax field.

Operaters with TaxfulPrice and TaxlessPrice objects.

discount_amount_value

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

save(*args, **kwargs)[source]
exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

group

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

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

id

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

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

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

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

shop

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

In the example:

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

Child.parent is a ForwardManyToOneDescriptor instance.

shuup.customer_group_pricing.module module

class shuup.customer_group_pricing.module.CustomerGroupPricingModule[source]

Bases: shuup.core.pricing.PricingModule

identifier = 'customer_group_pricing'
name = 'Customer Group Pricing'
get_price_info(context, product, quantity=1)[source]
class shuup.customer_group_pricing.module.CustomerGroupDiscountModule[source]

Bases: shuup.core.pricing.DiscountModule

identifier = 'customer_group_discount'
name = 'Customer Group Discount'
discount_price(context, product, price_info)[source]

Get the best discount amount for context.

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]
shuup.customer_group_pricing.signal_handers.handle_contact_group_m2m_changed(sender, instance, **kwargs)[source]
shuup.customer_group_pricing.signal_handers.handle_product_copy(sender, shop, copied, copy, **kwargs)[source]

Module contents

class shuup.customer_group_pricing.CustomerGroupPricingAppConfig(*args, **kwargs)[source]

Bases: shuup.apps.AppConfig

name = 'shuup.customer_group_pricing'
verbose_name = 'Shuup Customer Group Pricing'
label = 'shuup_customer_group_pricing'
provides = {'pricing_module': ['shuup.customer_group_pricing.module:CustomerGroupPricingModule'], 'discount_module': ['shuup.customer_group_pricing.module:CustomerGroupDiscountModule'], 'admin_product_form_part': ['shuup.customer_group_pricing.admin_form_part:CustomerGroupPricingFormPart', 'shuup.customer_group_pricing.admin_form_part:CustomerGroupPricingDiscountFormPart']}
ready()[source]