class*args, **kwargs)[source]

Stores an applied discount, so that deletion of discounts does not affect orders.

exception DoesNotExist
exception MultipleObjectsReturned

Default manager for the AppliedDiscount model


Calculate remaining discount excl. tax

Can either be used as related manager:


or directly:

class, name, type, value, currency, tax_class, config, code, is_active, valid_from, valid_until, allowed_uses, used)[source]
exception DoesNotExist
exception MultipleObjectsReturned
add_to(order, recalculate=True)[source]

Add discount to passed order

Removes the previous discount if a discount with this code has already been added to the order before.


Validate whether this discount can be applied on the given order

class*args, **kwargs)[source]

Base class for discounts and applied discounts

CONFIG_OPTIONS = [(u'all', {u'title': <django.utils.functional.__proxy__ object>}), (u'exclude_sale', {u'orderitem_query': <function <lambda>>, u'title': <django.utils.functional.__proxy__ object>})]

You can add and remove options at will, except for ‘all’: This option must always be available, and it cannot have any form fields