Customer¶
The customer app bundles communication with customers. This includes models to record product alerts and sent emails. It also contains the views that allow a customer to manage their data (profile information, shipping addresses, etc.)
Abstract models¶
-
class
oscar.apps.customer.abstract_models.
AbstractCommunicationEventType
(*args, **kwargs)[source]¶ A ‘type’ of communication. Like an order confirmation email.
-
code
¶ Code used for looking up this event programmatically.
-
get_messages
(ctx=None)[source]¶ Return a dict of templates with the context merged in
We look first at the field templates but fail over to a set of file templates that follow a conventional path.
-
name
¶ Name is the friendly description of an event for use in the admin
-
-
class
oscar.apps.customer.abstract_models.
AbstractEmail
(*args, **kwargs)[source]¶ This is a record of all emails sent to a customer. Normally, we only record order-related emails.
Forms¶
-
class
oscar.apps.customer.forms.
ConfirmPasswordForm
(user, *args, **kwargs)[source]¶ Extends the standard django AuthenticationForm, to support 75 character usernames. 75 character usernames are needed to support the EmailOrUsername auth backend.
-
class
oscar.apps.customer.forms.
EmailAuthenticationForm
(host, *args, **kwargs)[source]¶ Extends the standard django AuthenticationForm, to support 75 character usernames. 75 character usernames are needed to support the EmailOrUsername auth backend.
-
class
oscar.apps.customer.forms.
PasswordResetForm
(data=None, files=None, auto_id=u'id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None)[source]¶ This form takes the same structure as its parent from django.contrib.auth
Views¶
-
class
oscar.apps.customer.views.
AccountAuthView
(**kwargs)[source]¶ This is actually a slightly odd double form view that allows a customer to either login or register.
-
login_form_class
¶ alias of
EmailAuthenticationForm
-
-
class
oscar.apps.customer.views.
AccountSummaryView
(**kwargs)[source]¶ View that exists for legacy reasons and customisability. It commonly gets called when the user clicks on “Account” in the navbar.
Oscar defaults to just redirecting to the profile summary page (and that redirect can be configured via OSCAR_ACCOUNT_REDIRECT_URL), but it’s also likely you want to display an ‘account overview’ page or such like. The presence of this view allows just that, without having to change a lot of templates.
-
class
oscar.apps.customer.views.
AddressChangeStatusView
(**kwargs)[source]¶ Sets an address as default_for_(billing|shipping)
Alerts¶
The alerts module provides functionality that allows customers to sign up for email alerts when out-of-stock products come back in stock. A form for signing up is displayed on product detail pages when a product is not in stock.
If the OSCAR_EAGER_ALERTS` setting is ``True
, then alerts are sent as soon
as affected stock records are updated. Alternatively, the management command
oscar_send_alerts
can be used to send alerts periodically.
The context for the alert email body contains a hurry
variable that is set
to True
if the number of active alerts for a product is greater than the
quantity of the product available in stock.
Alerts are sent using the Communication Event framework.