Settings¶
A reference for Salesman’s settings module located at salesman/conf.py.
To use it in project:
from salesman.conf import app_settings
format_price = app_settings.SALESMAN_PRICE_FORMATTER
-
class
salesman.conf.DefaultSettings[source]¶ -
property
SALESMAN_PRODUCT_TYPES¶ A dictionary of product types and their respected serializers that are availible for purchase as product. Should be formated as
'app_label.Model': 'path.to.Serializer'.
-
property
SALESMAN_BASKET_MODIFIERS¶ A list of strings formated as
path.to.CustomModifier. Modifiers must extendsalesman.basket.modifiers.BasketModifierclass. and define a uniqueidentifierattribute.
-
property
SALESMAN_PAYMENT_METHODS¶ A list of strings formated as
path.to.CustomPayment. Payments must extendsalesman.checkout.payment.PaymentMethodclass and define a uniquenamespaceattribute.
-
property
SALESMAN_ADDRESS_VALIDATOR¶ A dotted path to address validator function. Function should accept a string value and return a validated version. Also recieves a
contextdictionary with additional validator context data likerequest, abasketobject andaddresstype (set to either shipping or billing).
-
property
SALESMAN_ORDER_STATUS¶ A dotted path to enum class that contains available order statuses. Overriden class must extend
salesman.orders.status.BaseOrderStatusclass. Can optionally override a class methodget_payablethat returns a list of statuses an order is eligible to be paid from,get_transitionsmethod that returns a dict of statuses with their transitions andvalidate_transitionmethod to validate status transitions.
-
property
SALESMAN_ORDER_REFERENCE_GENERATOR¶ A dotted path to reference generator function for new orders. Function should accept a django request object as param:
request. Value returned from the function will be slugified.
-
property
SALESMAN_PRICE_FORMATTER¶ A dotted path to price formatter function. Function should accept a value of type:
Decimaland return a price formatted string. Also recieves acontextdictionary with additional render data likerequestand either thebasketororderobject.
-
property
SALESMAN_ADMIN_REGISTER¶ Set to
Falseto skip saleman admin registration, in case you wish to build your ownModelAdminfor Django or Wagtail.
-
property
-
conf.app_settings= <salesman.conf.DefaultSettings object>¶