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 = None

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 = None

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.

class oscar.apps.customer.abstract_models.AbstractProductAlert(*args, **kwargs)[source]

An alert for when a product comes back in stock

get_random_key()[source]

Get a random generated key based on SHA-1 and email address

class oscar.apps.customer.abstract_models.AbstractUser(*args, **kwargs)[source]

An abstract base user suitable for use in Oscar projects.

This is basically a copy of the core AbstractUser model but without a username field

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)[source]

This form takes the same structure as its parent from django.contrib.auth

save(domain_override=None, use_https=False, request=None, **kwargs)[source]

Generates a one-use only link for resetting password and sends to the user.

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)

class oscar.apps.customer.views.AddressListView(**kwargs)[source]

Customer address book

get_queryset()[source]

Return customer’s addresses

class oscar.apps.customer.views.EmailDetailView(**kwargs)[source]

Customer email

get_page_title()[source]

Append email subject to page title

class oscar.apps.customer.views.OrderHistoryView(**kwargs)[source]

Customer order history

model

alias of Order

class oscar.apps.customer.views.OrderLineView(**kwargs)[source]

Customer order line