shoop.core package¶
Subpackages¶
- shoop.core.api package
- shoop.core.cache package
- shoop.core.defaults package
- shoop.core.fields package
- shoop.core.management package
- Subpackages
- shoop.core.management.commands package
- Submodules
- shoop.core.management.commands.compute_bought_with_relations module
- shoop.core.management.commands.makemessages module
- shoop.core.management.commands.shoop_init module
- shoop.core.management.commands.shoop_makemessages module
- shoop.core.management.commands.shoop_show_settings module
- Module contents
- shoop.core.management.commands package
- Module contents
- Subpackages
- shoop.core.models package
- shoop.core.modules package
- shoop.core.order_creator package
- shoop.core.pricing package
- shoop.core.shortcuts package
- shoop.core.stocks package
- shoop.core.suppliers package
- shoop.core.taxing package
- shoop.core.templatetags package
- shoop.core.utils package
- Submodules
- shoop.core.utils.form_mixins module
- shoop.core.utils.maintenance module
- shoop.core.utils.model_caching_descriptor module
- shoop.core.utils.name_mixin module
- shoop.core.utils.price_display module
- shoop.core.utils.prices module
- shoop.core.utils.product_bought_with_relations module
- shoop.core.utils.product_caching_object module
- shoop.core.utils.query module
- shoop.core.utils.slugs module
- shoop.core.utils.tax_numbers module
- shoop.core.utils.users module
- shoop.core.utils.vat module
- Module contents
Submodules¶
shoop.core.excs module¶
-
exception
shoop.core.excs.
ImmutabilityError
[source]¶ Bases:
ValueError
-
exception
shoop.core.excs.
ProductNotOrderableProblem
(message, title=None)[source]¶ Bases:
shoop.utils.excs.Problem
-
exception
shoop.core.excs.
ProductNotVisibleProblem
(message, title=None)[source]¶ Bases:
shoop.utils.excs.Problem
-
exception
shoop.core.excs.
ImpossibleProductModeException
(message, code=None)[source]¶ Bases:
ValueError
shoop.core.middleware module¶
shoop.core.settings module¶
-
shoop.core.settings.
SHOOP_HOME_CURRENCY
= 'EUR'¶ The home currency for the Shoop installation. All monetary values are implicitly in this currency unless somehow otherwise specified.
-
shoop.core.settings.
SHOOP_ADDRESS_HOME_COUNTRY
= None¶ The home country code (ISO 3166-1 alpha 2) for the Shoop installation. Among other things, addresses that would be printed with this country visible are printed with no country.
-
shoop.core.settings.
SHOOP_ALLOW_ANONYMOUS_ORDERS
= True¶ Whether or not anonymous orders (without a
creator
user) are allowed.
-
shoop.core.settings.
SHOOP_ORDER_IDENTIFIER_METHOD
= 'id'¶ Which method is used to calculate order identifiers (“order numbers”). May be either the string “id”, a callable or a spec string pointing to a callable that must return a string given an
order
.
-
shoop.core.settings.
SHOOP_REFERENCE_NUMBER_METHOD
= 'unique'¶ Which method is used to calculate order reference numbers.
May be a spec string pointing to a callable that must return a string given an Order, or one of the following built-in generators.
unique
- Unique reference number based on time and the order ID. The reference number has the Finnish bank reference check digit appended, making the reference number valid for Finnish bank transfers.
running
- Ascending reference number. The length of the reference number will be
SHOOP_REFERENCE_NUMBER_LENGTH
+ 1 (for the check digit described below).SHOOP_REFERENCE_NUMBER_PREFIX
is prepended, if set. The reference number has the Finnish bank reference check digit appended, making the reference number valid for Finnish bank transfers. shop_running
- As
running
, but with the shop ID prepended.
-
shoop.core.settings.
SHOOP_REFERENCE_NUMBER_LENGTH
= 10¶ The length of reference numbers generated by certain reference number generators.
-
shoop.core.settings.
SHOOP_REFERENCE_NUMBER_PREFIX
= ''¶ An arbitrary (numeric) prefix for certain reference number generators.
-
shoop.core.settings.
SHOOP_PRICING_MODULE
= 'customer_group_pricing'¶ The identifier of the pricing module to use for pricing products.
Determines how product prices are calculated. See
shoop.core.pricing
for details.
-
shoop.core.settings.
SHOOP_DISCOUNT_MODULES
= ['catalog_campaigns']¶ List of identifiers of discount modules to use.
Each discount module may change the price of a product. See
shoop.core.pricing.DiscountModule
for details.
-
shoop.core.settings.
SHOOP_ORDER_SOURCE_MODIFIER_MODULES
= ['basket_campaigns']¶ List of identifiers of order source modifier modules.
See
shoop.core.order_creator.OrderSourceModifierModule
for details.
-
shoop.core.settings.
SHOOP_TAX_MODULE
= 'default_tax'¶ The identifier of the tax module to use for determining taxes of products and order lines.
Determines taxing rules for products, shipping/payment methods and other order lines. See
shoop.core.taxing
for details.
-
shoop.core.settings.
SHOOP_ENABLE_ATTRIBUTES
= True¶ Whether product attributes are enabled. For installations not requiring attributes, disabling this may confer a small performance increase.
-
shoop.core.settings.
SHOOP_ENABLE_MULTIPLE_SHOPS
= False¶ Whether multiple shops are expected to be enabled in this installation. Enabling or disabling this flag does not make it (im)possible to set up multiple shops, but having it disabled may confer a small performance increase.
-
shoop.core.settings.
SHOOP_ENABLE_MULTIPLE_SUPPLIERS
= False¶ Whether multiple suppliers are enabled in this installation. Enabling this flag prevents supplier creation from admin.
-
shoop.core.settings.
SHOOP_ORDER_LABELS
= [('default', 'Default')]¶ A list of order labels (2-tuples of internal identifier / visible name).
Order labels serve as a simple taxonomy layer for easy “tagging” of orders even within a single Shop. For instance, an installation could define
"default"
and"internal"
order labels, which are then usable in reports, admin filtering, etc.
-
shoop.core.settings.
SHOOP_DEFAULT_ORDER_LABEL
= 'default'¶ The order label (see
SHOOP_ORDER_LABELS
) to apply to orders by default. This should naturally be one of the keys inSHOOP_ORDER_LABELS
.
-
shoop.core.settings.
SHOOP_ORDER_KNOWN_PAYMENT_DATA_KEYS
= []¶ A list of “known keys” within the
Order.payment_data
property bag.The format of this setting is a list of 2-tuples of dict key / visible name, for example
[("ssn", "Social Security Number")]
.For installations where customizations may save some human-readable, possibly important information in
payment_data
, this setting may be used to make this data easily visible in the administration backend.
-
shoop.core.settings.
SHOOP_ORDER_KNOWN_SHIPPING_DATA_KEYS
= []¶ A list of “known keys” within the
Order.shipping_data
property bag.The format of this setting is a list of 2-tuples of dict key / visible name, for example
[("shipping_instruction", "Special Shipping Instructions")]
.For installations where customizations may save some human-readable, possibly important information in
shipping_data
, this setting may be used to make this data easily visible in the administration backend.
-
shoop.core.settings.
SHOOP_ORDER_KNOWN_EXTRA_DATA_KEYS
= []¶ A list of “known keys” within the
Order.extra_data
property bag.The format of this setting is a list of 2-tuples of dict key / visible name, for example
[("wrapping_color", "Wrapping Paper Color")]
.For installations where customizations may save some human-readable, possibly important information in
extra_data
, this setting may be used to make this data easily visible in the administration backend.
-
shoop.core.settings.
SHOOP_TELEMETRY_ENABLED
= True¶ A flag to enable/disable the telemetry system
-
shoop.core.settings.
SHOOP_TELEMETRY_URL
= 'https://telemetry.shoop.io/collect/'¶ The submission URL for Shoop’s telemetry (statistics) system
-
shoop.core.settings.
SHOOP_DEFAULT_CACHE_DURATION
= 1800¶ Default cache duration for various caches in seconds
-
shoop.core.settings.
SHOOP_CACHE_DURATIONS
= {}¶ Overrides for default cache durations by key namespace. These override possible defaults in
shoop.core.cache.impl.DEFAULT_CACHE_DURATIONS
.
-
shoop.core.settings.
SHOOP_CALCULATE_TAXES_AUTOMATICALLY_IF_POSSIBLE
= True¶ Whether taxes should be calculated automatically in TaxModule
shoop.core.signals module¶
shoop.core.telemetry module¶
-
shoop.core.telemetry.
get_installation_key
()[source]¶ Get the unique installation ID for this Shoop instance.
If one doesn’t exist, it’s generated and saved at this point.
Returns: Installation key string Return type: str
-
shoop.core.telemetry.
is_in_grace_period
()[source]¶ Return True if the telemetry module is within the 24-hours-from-installation grace period where no stats are sent. This is to “safely” allow opting out of telemetry without leaving a trace.
Returns: Graceness flag. Return type: bool
-
shoop.core.telemetry.
set_opt_out
(flag)[source]¶ Set whether this installation is opted-out from telemetry submissions.
Parameters: flag (bool) – Opt-out flag. True for opt-out, false for opt-in (default) Returns: New flag state Return type: bool
-
shoop.core.telemetry.
save_telemetry_submission
(data)[source]¶ Save a blob of data as the latest telemetry submission.
Naturally updates the latest submission time.
Parameters: data (dict) – A blob of data.
-
shoop.core.telemetry.
get_telemetry_data
(request, indent=None)[source]¶ Get the telemetry data that would be sent.
Parameters: request (django.http.HttpRequest|None) – HTTP request. Optional. Returns: Data blob. Return type: str
-
shoop.core.telemetry.
try_send_telemetry
(request=None, max_age_hours=72, raise_on_error=False)[source]¶ Send telemetry information (unless opted-out, in grace period or disabled).
Parameters: - request (django.http.HttpRequest|None) – HTTP request. Optional.
- max_age_hours (int|None) – How many hours must have passed since the last submission to be able to resend. If None, not checked.
- raise_on_error (bool) – Raise exceptions when telemetry is not sent instead of quietly returning False.
Returns: Sent data (possibly with response information) or False if not sent.
Return type: dict|bool
Module contents¶
-
class
shoop.core.
ShoopCoreAppConfig
(*args, **kwargs)[source]¶ Bases:
shoop.apps.AppConfig
-
name
= 'shoop.core'¶
-
verbose_name
= 'Shoop Core'¶
-
label
= 'shoop'¶
-
required_installed_apps
= ('django.contrib.auth', 'django.contrib.contenttypes', 'easy_thumbnails', 'filer')¶
-
provides
= {'pricing_module': ['shoop.core.pricing.default_pricing:DefaultPricingModule'], 'api_populator': ['shoop.core.api:populate_core_api']}¶
-