shoop.admin package¶
Subpackages¶
- shoop.admin.dashboard package
- shoop.admin.forms package
- shoop.admin.modules package
- Subpackages
- shoop.admin.modules.attributes package
- shoop.admin.modules.categories package
- shoop.admin.modules.contact_groups package
- shoop.admin.modules.contacts package
- shoop.admin.modules.demo package
- shoop.admin.modules.manufacturers package
- shoop.admin.modules.media package
- shoop.admin.modules.orders package
- Subpackages
- shoop.admin.modules.orders.views package
- Submodules
- shoop.admin.modules.orders.views.detail module
- shoop.admin.modules.orders.views.edit module
- shoop.admin.modules.orders.views.list module
- shoop.admin.modules.orders.views.log module
- shoop.admin.modules.orders.views.payment module
- shoop.admin.modules.orders.views.refund module
- shoop.admin.modules.orders.views.shipment module
- Module contents
- shoop.admin.modules.orders.views package
- Submodules
- shoop.admin.modules.orders.dashboard module
- shoop.admin.modules.orders.json_order_creator module
- shoop.admin.modules.orders.receivers module
- shoop.admin.modules.orders.sections module
- Module contents
- Subpackages
- shoop.admin.modules.permission_groups package
- shoop.admin.modules.product_types package
- shoop.admin.modules.products package
- Subpackages
- shoop.admin.modules.products.forms package
- Submodules
- shoop.admin.modules.products.forms.base_forms module
- shoop.admin.modules.products.forms.package_forms module
- shoop.admin.modules.products.forms.parent_forms module
- shoop.admin.modules.products.forms.simple_variation_forms module
- shoop.admin.modules.products.forms.variable_variation_forms module
- Module contents
- shoop.admin.modules.products.views package
- Submodules
- shoop.admin.modules.products.views.delete module
- shoop.admin.modules.products.views.edit module
- shoop.admin.modules.products.views.edit_cross_sell module
- shoop.admin.modules.products.views.edit_media module
- shoop.admin.modules.products.views.edit_package module
- shoop.admin.modules.products.views.edit_parent module
- shoop.admin.modules.products.views.edit_variation module
- shoop.admin.modules.products.views.list module
- shoop.admin.modules.products.views.toolbars module
- Module contents
- shoop.admin.modules.products.forms package
- Submodules
- shoop.admin.modules.products.utils module
- Module contents
- Subpackages
- shoop.admin.modules.sales_units package
- shoop.admin.modules.service_providers package
- shoop.admin.modules.services package
- shoop.admin.modules.shops package
- shoop.admin.modules.suppliers package
- shoop.admin.modules.system package
- shoop.admin.modules.taxes package
- shoop.admin.modules.users package
- Module contents
- Subpackages
- shoop.admin.template_helpers package
- shoop.admin.templatetags package
- shoop.admin.utils package
- shoop.admin.views package
Submodules¶
shoop.admin.base module¶
-
class
shoop.admin.base.
AdminModule
[source]¶ Bases:
object
-
name
= '_Base_'¶
Return type: dict[str,str]
Return type: list[shoop.admin.base.MenuEntry]
-
get_activity
(request, cutoff)[source]¶ Parameters: - cutoff (datetime.datetime) – Cutoff datetime
- request (django.http.request.HttpRequest) – Request
Returns: list[shoop.admin.base.Activity]
-
get_model_url
(object, kind)[source]¶ Retrieve an admin URL for the given object of the kind
kind
.A falsy value must be returned if the module does not know how to reverse the given object.
Parameters: - object (django.db.models.Model) – A object instance (or object class).
- kind (str) – URL kind. Currently “detail”, “list” or “new”.
Returns: The reversed URL or none.
Return type: str|None
-
-
class
shoop.admin.base.
Resolvable
[source]¶ Bases:
object
-
url
¶ Resolve this object’s
_url
to an actual URL.Returns: URL or no URL. Return type: str|None
-
original_url
¶
-
-
class
shoop.admin.base.
MenuEntry
(text, url, icon=None, category=None, aliases=())[source]¶ Bases:
shoop.admin.base.Resolvable
-
class
shoop.admin.base.
SearchResult
(text, url, icon=None, category=None, is_action=False, relevance=100, target=None)[source]¶ Bases:
shoop.admin.base.Resolvable
-
class
shoop.admin.base.
Notification
(text, title=None, url=None, kind='info', dismissal_url=None, datetime=None)[source]¶ Bases:
shoop.admin.base.Resolvable
Parameters: - text (str) – The notification’s text.
- title (str|None) – An optional title for the notification.
- url (str|None) – The optional main URL for the notification.
- kind (str) – The kind of the notification (see KINDS)
- dismissal_url (str|None) – An optional dismissal URL for the notification. The admin framework will add a button that will cause an AJAX post into this URL.
- datetime (datetime) – An optional date+time for this notification.
-
KINDS
= ('info', 'success', 'warning', 'danger')¶
-
class
shoop.admin.base.
Activity
(datetime, text, url=None)[source]¶ Bases:
shoop.admin.base.Resolvable
-
class
shoop.admin.base.
OrderSection
[source]¶ Bases:
object
Subclass this and add the class to the
admin_order_section
provide list to show a custom section on the order detail on admin.identifier
must be uniquename
the section captionicon
the section icontemplate
the section template fileextra_js
the section extra javascript template file,set a file which contains js code inside a <script> tagorder
the order-
identifier
= ''¶
-
name
= ''¶
-
icon
= ''¶
-
template
= ''¶
-
extra_js
= ''¶
-
order
= 0¶
-
shoop.admin.breadcrumbs module¶
Bases:
object
Infer breadcrumbs from the rendering context.
Parameters: context (jinja2.runtime.Context) – Jinja Context Returns: Breadcrumbs object or None if things fail Return type: Breadcrumbs|None
shoop.admin.currencybound module¶
-
class
shoop.admin.currencybound.
CurrencyBound
(currency=None, *args, **kwargs)[source]¶ Bases:
object
Mixin for adding currency property defaulting currency of the first Shop.
The currency property is “lazy” so that database is not accessed on initialization, since this mixin will be used by some
AdminModule
classes and they will be initialized at import time bymodule_registry.register
(which is called at import becauseadmin.urls
callsget_module_urls
at import).-
currency
¶
-
shoop.admin.form_part module¶
-
class
shoop.admin.form_part.
TemplatedFormDef
(name, form_class, template_name, required=True, kwargs=None)[source]¶
shoop.admin.module_registry module¶
-
shoop.admin.module_registry.
replace_modules
(new_module_classes)[source]¶ Context manager to temporarily replace all modules with something else.
Test utility, mostly.
>>> def some_test(): ... with replace_modules(["foo.bar:QuuxModule"]): ... pass # do stuff
Parameters: new_module_classes – Iterable of module classes, like you’d pass to register
shoop.admin.toolbar module¶
-
class
shoop.admin.toolbar.
BaseActionButton
(text='', icon=None, disable_reason=None, tooltip=None, extra_css_class='btn-default')[source]¶ Bases:
object
Parameters: - text – The actual text for the button.
- icon – Icon CSS class string
- disable_reason (str|None) – The reason for this button to be disabled. It’s considered good UX to have an user-visible reason for disabled actions; thus the only way to disable an action is to set the reason. See http://stackoverflow.com/a/372503/51685.
- tooltip (str|None) – Tooltip string, if any. May be replaced by the disable reason.
- extra_css_class (str) – Extra CSS class(es)
-
base_css_classes
= ('btn',)¶
-
class
shoop.admin.toolbar.
URLActionButton
(url, **kwargs)[source]¶ Bases:
shoop.admin.toolbar.BaseActionButton
An action button that renders as a link leading to
url
.Parameters: url (str) – The URL to navigate to. For convenience, if this contains no slashes, reverse
is automatically called on it.
-
class
shoop.admin.toolbar.
NewActionButton
(url, **kwargs)[source]¶ Bases:
shoop.admin.toolbar.URLActionButton
An URL button with sane “new” visual semantics
-
class
shoop.admin.toolbar.
JavaScriptActionButton
(onclick, **kwargs)[source]¶ Bases:
shoop.admin.toolbar.BaseActionButton
An action button that uses
onclick
for action dispatch.
-
class
shoop.admin.toolbar.
PostActionButton
(post_url=None, name=None, value=None, form_id=None, confirm=None, **kwargs)[source]¶ Bases:
shoop.admin.toolbar.BaseActionButton
An action button that renders as a button POSTing a form containing
name`=`value
topost_url
.
-
class
shoop.admin.toolbar.
DropdownActionButton
(items, split_button=None, **kwargs)[source]¶ Bases:
shoop.admin.toolbar.BaseActionButton
An action button with a chevron button to open a dropdown menu.
-
base_css_classes
= ('btn', 'dropdown-toggle')¶
-
-
class
shoop.admin.toolbar.
DropdownItem
(url='#', onclick=None, **kwargs)[source]¶ Bases:
shoop.admin.toolbar.BaseActionButton
An item to be shown in a
DropdownActionButton
.-
base_css_classes
= ()¶
-
-
class
shoop.admin.toolbar.
DropdownDivider
(text='', icon=None, disable_reason=None, tooltip=None, extra_css_class='btn-default')[source]¶ Bases:
shoop.admin.toolbar.BaseActionButton
A Divider for DropdownActionButtons.
Parameters: - text – The actual text for the button.
- icon – Icon CSS class string
- disable_reason (str|None) – The reason for this button to be disabled. It’s considered good UX to have an user-visible reason for disabled actions; thus the only way to disable an action is to set the reason. See http://stackoverflow.com/a/372503/51685.
- tooltip (str|None) – Tooltip string, if any. May be replaced by the disable reason.
- extra_css_class (str) – Extra CSS class(es)
-
base_css_classes
= ()¶
-
class
shoop.admin.toolbar.
DropdownHeader
(text='', icon=None, disable_reason=None, tooltip=None, extra_css_class='btn-default')[source]¶ Bases:
shoop.admin.toolbar.BaseActionButton
Header for DropdownActionButtons.
Parameters: - text – The actual text for the button.
- icon – Icon CSS class string
- disable_reason (str|None) – The reason for this button to be disabled. It’s considered good UX to have an user-visible reason for disabled actions; thus the only way to disable an action is to set the reason. See http://stackoverflow.com/a/372503/51685.
- tooltip (str|None) – Tooltip string, if any. May be replaced by the disable reason.
- extra_css_class (str) – Extra CSS class(es)
-
base_css_classes
= ()¶
-
shoop.admin.toolbar.
get_default_edit_toolbar
(view_object, save_form_id, discard_url=None, delete_url=None, with_split_save=True, toolbar=None)[source]¶ Get a toolbar with buttons used for object editing.
Parameters: - view_object (django.views.generic.UpdateView) – The class-based-view object requiring the toolbar
- save_form_id (str) – The DOM ID to target for the save button
- discard_url (str|None) – The URL/route name for the Discard button. Falsy values default to the request URL.
- delete_url (str|None) – The URL/route name for the Delete button. If this is not set, the delete button is not shown.
- with_split_save (bool) – Use split delete button with “Save and Exit” etc.?
- toolbar (Toolbar) – The toolbar to augment. If None, a new one is created.
Returns: Toolbar
Return type:
shoop.admin.urls module¶
Module contents¶
-
class
shoop.admin.
ShoopAdminAppConfig
(*args, **kwargs)[source]¶ Bases:
shoop.apps.AppConfig
-
name
= 'shoop.admin'¶
-
verbose_name
= 'Shoop Admin'¶
-
label
= 'shoop_admin'¶
-
required_installed_apps
= ['bootstrap3']¶
-
provides
= {'service_behavior_component_form_part': ['shoop.admin.modules.services.weight_based_pricing.WeightBasedPricingFormPart'], 'service_provider_admin_form': ['shoop.admin.modules.service_providers.forms:CustomCarrierForm', 'shoop.admin.modules.service_providers.forms:CustomPaymentProcessorForm'], 'admin_order_section': ['shoop.admin.modules.orders.sections:ContentsOrderSection', 'shoop.admin.modules.orders.sections:PaymentOrderSection', 'shoop.admin.modules.orders.sections:LogEntriesOrderSection'], 'service_behavior_component_form': ['shoop.admin.modules.services.forms:FixedCostBehaviorComponentForm', 'shoop.admin.modules.services.forms:WaivingCostBehaviorComponentForm', 'shoop.admin.modules.services.forms:WeightLimitsBehaviorComponentForm', 'shoop.admin.modules.services.forms:GroupAvailabilityBehaviorComponentForm', 'shoop.admin.modules.services.forms.StaffOnlyBehaviorComponentForm', 'shoop.admin.modules.services.forms:RoundingBehaviorComponentForm'], 'admin_module': ['shoop.admin.modules.system:SystemModule', 'shoop.admin.modules.products:ProductModule', 'shoop.admin.modules.product_types:ProductTypeModule', 'shoop.admin.modules.media:MediaModule', 'shoop.admin.modules.orders:OrderModule', 'shoop.admin.modules.taxes:TaxModule', 'shoop.admin.modules.categories:CategoryModule', 'shoop.admin.modules.contacts:ContactModule', 'shoop.admin.modules.contact_groups:ContactGroupModule', 'shoop.admin.modules.permission_groups:PermissionGroupModule', 'shoop.admin.modules.users:UserModule', 'shoop.admin.modules.service_providers:ServiceProviderModule', 'shoop.admin.modules.services:PaymentMethodModule', 'shoop.admin.modules.services:ShippingMethodModule', 'shoop.admin.modules.attributes:AttributeModule', 'shoop.admin.modules.sales_units:SalesUnitModule', 'shoop.admin.modules.shops:ShopModule', 'shoop.admin.modules.demo:DemoModule', 'shoop.admin.modules.manufacturers:ManufacturerModule', 'shoop.admin.modules.suppliers:SupplierModule']}¶
-