Core

Core app reference.

Utils

salesman.core.utils.format_price(value: decimal.Decimal, context: dict = {}) → str[source]

Default price format function. Can be overriden by providing a dotted path to a function in SALESMAN_PRICE_FORMATTER setting.

Parameters
  • value (Decimal) – Number value to be formatted

  • context (dict, optional) – Format context data. Defaults to {}.

Returns

Formatted price as string

Return type

str

Models

class salesman.core.models.JSONField(*args, **kwargs)[source]

Simple JSON field.

Serializers

class salesman.core.serializers.PriceField(**kwargs)[source]

Price field used to display formated price whitin a serializer.