shop.modules.discount_condition =============================== .. py:module:: shop.modules.discount_condition Attributes ---------- .. autoapisummary:: shop.modules.discount_condition.logger shop.modules.discount_condition.CODE_CHARS shop.modules.discount_condition.CODE_LENGTH shop.modules.discount_condition.SUFFIX_LENGTH shop.modules.discount_condition.lock_get_skel Classes ------- .. autoapisummary:: shop.modules.discount_condition.DiscountCondition Module Contents --------------- .. py:data:: logger .. py:data:: CODE_CHARS .. py:data:: CODE_LENGTH :value: 8 .. py:data:: SUFFIX_LENGTH :value: 6 .. py:data:: lock_get_skel Lock to make the get_skel cache thread-safe .. py:class:: DiscountCondition Bases: :py:obj:`shop.modules.abstract.ShopModuleAbstract`, :py:obj:`viur.core.prototypes.List` .. py:attribute:: moduleName :value: 'discount_condition' .. py:attribute:: kindName :value: '{{viur_shop_modulename}}_discount_condition' .. py:method:: adminInfo() .. py:method:: canEdit(skel) .. py:method:: editSkel(*args, **kwargs) .. py:method:: onAdd(skel) .. py:method:: onEdit(skel) .. py:method:: onClone(skel, src_skel) .. py:method:: onAdded(skel) .. py:method:: onEdited(skel) .. py:method:: onCloned(skel, src_skel) .. py:method:: on_change(skel, event) .. py:method:: on_changed(skel, event) .. py:method:: generate_subcodes(parent_key, prefix, amount) Generate subcodes for a parent individual code. .. py:method:: get_skel(key) :classmethod: .. py:method:: get_by_code(code = None) .. py:method:: get_discounts_from_cart(cart_key) .. py:method:: mark_discount_used(order_skel, payment, *args, **kwargs) :staticmethod: Increase quantity_used on discount of an ordered cart