shuup.front.apps.customer_information package

Submodules

shuup.front.apps.customer_information.dashboard_items module

class shuup.front.apps.customer_information.dashboard_items.CustomerDashboardItem(request)[source]

Bases: DashboardItem

template_name = 'shuup/customer_information/customer_dashboard_item.jinja'

Title shown in dashboard menu and in dashboard

title = 'Customer Information'

Sequence number of dashboard item

icon = 'fa fa-user'

Text for dashboard

If your dashboard item shows single object, Edit is just fine but if you are listing objects, Show All might be better.

get_context()[source]

Get context for template

This is usually overridden in subclasses.

Returns:

Dict of context items

Return type:

dict

class shuup.front.apps.customer_information.dashboard_items.CompanyDashboardItem(request)[source]

Bases: DashboardItem

title = 'Company Information'

Sequence number of dashboard item

description = 'Edit Company Information.'
icon = 'fa fa-building'

Text for dashboard

If your dashboard item shows single object, Edit is just fine but if you are listing objects, Show All might be better.

show_on_dashboard()[source]

Defines if the item is shown in dashboard

Returns:

True or False if item should be shown in dashboard

Return type:

bool

show_on_menu()[source]

Defines if the item is shown in the main dashboard menu

Returns:

True or False if item should be shown in menu

Return type:

bool

class shuup.front.apps.customer_information.dashboard_items.AddressBookDashboardItem(request)[source]

Bases: DashboardItem

title = 'Address Book'

Sequence number of dashboard item

description = 'Address Book'
icon = 'fa fa-building'

Text for dashboard

If your dashboard item shows single object, Edit is just fine but if you are listing objects, Show All might be better.

show_on_dashboard()[source]

Defines if the item is shown in dashboard

Returns:

True or False if item should be shown in dashboard

Return type:

bool

shuup.front.apps.customer_information.forms module

class shuup.front.apps.customer_information.forms.PersonContactForm(*args, **kwargs)[source]

Bases: ModelForm

class Meta[source]

Bases: object

model

alias of PersonContact

fields = ('first_name', 'last_name', 'phone', 'email', 'gender', 'language', 'marketing_permission', 'timezone', 'picture')
__init__(*args, **kwargs)[source]
save(commit=True)[source]

Save this form’s self.instance object if commit=True. Otherwise, add a save_m2m() method to the form which can be called after the instance is saved manually at a later time. Return the model instance.

base_fields = {'email': <django.forms.fields.EmailField object>, 'first_name': <django.forms.fields.CharField object>, 'gender': <enumfields.forms.EnumChoiceField object>, 'language': <shuup.core.fields.LanguageFormField object>, 'last_name': <django.forms.fields.CharField object>, 'marketing_permission': <django.forms.fields.BooleanField object>, 'phone': <django.forms.fields.CharField object>, 'picture': <filer.fields.image.AdminImageFormField object>, 'timezone': <django.forms.fields.TypedChoiceField object>}
declared_fields = {'language': <shuup.core.fields.LanguageFormField object>}
property media

Return all media required to render the widgets on this form.

class shuup.front.apps.customer_information.forms.CompanyContactForm(*args, **kwargs)[source]

Bases: ModelForm

class Meta[source]

Bases: object

model

alias of CompanyContact

fields = ('name', 'tax_number', 'phone', 'email', 'marketing_permission', 'picture')
__init__(*args, **kwargs)[source]
clean_tax_number()[source]

Clean Tax Number.

This is done because we want to prevent duplicates in the front-end.

base_fields = {'email': <django.forms.fields.EmailField object>, 'marketing_permission': <django.forms.fields.BooleanField object>, 'name': <django.forms.fields.CharField object>, 'phone': <django.forms.fields.CharField object>, 'picture': <filer.fields.image.AdminImageFormField object>, 'tax_number': <django.forms.fields.CharField object>}
declared_fields = {}
property media

Return all media required to render the widgets on this form.

class shuup.front.apps.customer_information.forms.SavedAddressForm(data=None, files=None, auto_id='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, renderer=None)[source]

Bases: Form

base_fields = {'role': <enumfields.forms.EnumChoiceField object>, 'status': <enumfields.forms.EnumChoiceField object>, 'title': <django.forms.fields.CharField object>}
declared_fields = {'role': <enumfields.forms.EnumChoiceField object>, 'status': <enumfields.forms.EnumChoiceField object>, 'title': <django.forms.fields.CharField object>}
property media

Return all media required to render the widgets on this form.

class shuup.front.apps.customer_information.forms.CustomerInformationFormGroup(*args, **kwargs)[source]

Bases: FormGroup

address_forms = ['billing', 'shipping']
__init__(*args, **kwargs)[source]
save()[source]
class shuup.front.apps.customer_information.forms.CompanyInformationFormGroup(*args, **kwargs)[source]

Bases: FormGroup

address_forms = ['billing', 'shipping']
__init__(*args, **kwargs)[source]
save()[source]
class shuup.front.apps.customer_information.forms.AddressBookFormGroup(*args, **kwargs)[source]

Bases: FormGroup

saved_address_form

alias of SavedAddressForm

__init__(*args, **kwargs)[source]
save()[source]

shuup.front.apps.customer_information.notify_events module

class shuup.front.apps.customer_information.notify_events.CompanyAccountCreated(**variable_values)[source]

Bases: Event

identifier = 'company_account_created'
bindings = {}
name = 'Company Account Created'
variables = {'contact': <shuup.notify.base.Variable object>, 'customer_email': <shuup.notify.base.Variable object>}

shuup.front.apps.customer_information.settings module

shuup.front.apps.customer_information.settings.SHUUP_CUSTOMER_INFORMATION_EDIT_FORM = 'shuup.front.apps.customer_information.forms:CustomerInformationFormGroup'

The default customer information edit form

shuup.front.apps.customer_information.settings.SHUUP_COMPANY_INFORMATION_EDIT_FORM = 'shuup.front.apps.customer_information.forms:CompanyInformationFormGroup'

The default company information edit form

shuup.front.apps.customer_information.settings.SHUUP_ADDRESS_BOOK_EDIT_FORM = 'shuup.front.apps.customer_information.forms:AddressBookFormGroup'

The default address book edit form

shuup.front.apps.customer_information.settings.SHUUP_CUSTOMER_INFORMATION_ALLOW_PICTURE_UPLOAD = False

Allow customers to upload profile picture

shuup.front.apps.customer_information.urls module

shuup.front.apps.customer_information.views module

class shuup.front.apps.customer_information.views.CustomPasswordChangeView(**kwargs)[source]

Bases: PasswordChangeView

Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.

template_name = 'shuup/customer_information/change_password.jinja'
success_url = '/customer/'
form_class

alias of PasswordChangeForm

post(*args, **kwargs)[source]

Handle POST requests: instantiate a form instance with the passed POST variables and then check if it’s valid.

get_form_kwargs()[source]

Return the keyword arguments for instantiating the form.

class shuup.front.apps.customer_information.views.CustomerEditView(**kwargs)[source]

Bases: DashboardViewMixin, FormView

Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.

template_name = 'shuup/customer_information/edit_customer.jinja'
get_form_class()[source]

Return the form class to use.

get_form_kwargs()[source]

Return the keyword arguments for instantiating the form.

form_valid(form)[source]

If the form is valid, redirect to the supplied URL.

class shuup.front.apps.customer_information.views.CompanyEditView(**kwargs)[source]

Bases: DashboardViewMixin, FormView

Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.

template_name = 'shuup/customer_information/edit_company.jinja'
dispatch(request, *args, **kwargs)[source]
get_form_class()[source]

Return the form class to use.

get_form_kwargs()[source]

Return the keyword arguments for instantiating the form.

form_valid(form)[source]

If the form is valid, redirect to the supplied URL.

get_context_data(**kwargs)[source]

Insert the form into the context dict.

class shuup.front.apps.customer_information.views.AddressBookView(**kwargs)[source]

Bases: DashboardViewMixin, TemplateView

Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.

template_name = 'shuup/customer_information/addressbook/index.jinja'
get_context_data(**kwargs)[source]
class shuup.front.apps.customer_information.views.AddressBookEditView(**kwargs)[source]

Bases: DashboardViewMixin, FormView

Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.

template_name = 'shuup/customer_information/addressbook/edit.jinja'
instance = None
dispatch(request, *args, **kwargs)[source]
get_form_class()[source]

Return the form class to use.

get_form_kwargs()[source]

Return the keyword arguments for instantiating the form.

form_valid(form)[source]

If the form is valid, redirect to the supplied URL.

shuup.front.apps.customer_information.views.delete_address(request, pk)[source]

Module contents

class shuup.front.apps.customer_information.AppConfig(*args, **kwargs)[source]

Bases: AppConfig

name = 'shuup.front.apps.customer_information'
verbose_name = 'Shuup Frontend - Customer Information Editing'
label = 'shuup_front_customer_information'
provides = {'customer_dashboard_items': ['shuup.front.apps.customer_information.dashboard_items:CustomerDashboardItem', 'shuup.front.apps.customer_information.dashboard_items:CompanyDashboardItem', 'shuup.front.apps.customer_information.dashboard_items:AddressBookDashboardItem'], 'front_urls': ['shuup.front.apps.customer_information.urls:urlpatterns'], 'notify_event': ['shuup.front.apps.customer_information.notify_events:CompanyAccountCreated']}

See /provides for details about the provides variable.