shuup.admin.modules.contacts package

Subpackages

Submodules

shuup.admin.modules.contacts.form_parts module

class shuup.admin.modules.contacts.form_parts.CompanyContactBaseFormPart(request, object=None)[source]

Bases: FormPart

priority: int = -1000
get_form_defs()[source]
form_valid(form)[source]
class shuup.admin.modules.contacts.form_parts.PersonContactBaseFormPart(request, object=None)[source]

Bases: FormPart

priority: int = -1000
get_user()[source]
get_form_defs()[source]
form_valid(form)[source]
class shuup.admin.modules.contacts.form_parts.ContactAddressesFormPart(request, object=None)[source]

Bases: FormPart

priority: int = -900
get_form_defs()[source]
form_valid(form)[source]

shuup.admin.modules.contacts.forms module

class shuup.admin.modules.contacts.forms.ContactBaseFormMixin(*args, **kwargs)[source]

Bases: object

__init__(*args, **kwargs)[source]
init_fields()[source]
save(commit=True)[source]
class shuup.admin.modules.contacts.forms.PersonContactBaseForm(user=None, *args, **kwargs)[source]

Bases: ContactBaseFormMixin, ModelForm

class Meta[source]

Bases: object

model

alias of PersonContact

fields = ['first_name', 'last_name', 'gender', 'language', 'birth_date', 'is_active', 'marketing_permission', 'phone', 'www', 'timezone', 'prefix', 'suffix', 'name_ext', 'email', 'tax_group', 'merchant_notes', 'account_manager', 'picture']
__init__(user=None, *args, **kwargs)[source]
init_fields()[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 = {'account_manager': <django.forms.models.ModelChoiceField object>, 'birth_date': <django.forms.fields.DateField object>, 'email': <django.forms.fields.EmailField object>, 'first_name': <django.forms.fields.CharField object>, 'gender': <enumfields.forms.EnumChoiceField object>, 'is_active': <django.forms.fields.BooleanField object>, 'language': <shuup.core.fields.LanguageFormField object>, 'last_name': <django.forms.fields.CharField object>, 'marketing_permission': <django.forms.fields.BooleanField object>, 'merchant_notes': <django.forms.fields.CharField object>, 'name_ext': <django.forms.fields.CharField object>, 'phone': <django.forms.fields.CharField object>, 'picture': <filer.fields.image.AdminImageFormField object>, 'prefix': <django.forms.fields.CharField object>, 'suffix': <django.forms.fields.CharField object>, 'tax_group': <django.forms.models.ModelChoiceField object>, 'timezone': <django.forms.fields.TypedChoiceField object>, 'www': <django.forms.fields.URLField object>}
declared_fields = {'language': <shuup.core.fields.LanguageFormField object>}
property media

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

class shuup.admin.modules.contacts.forms.CompanyContactBaseForm(*args, **kwargs)[source]

Bases: ContactBaseFormMixin, ModelForm

class Meta[source]

Bases: object

model

alias of CompanyContact

fields = ['name', 'tax_number', 'members', 'is_active', 'marketing_permission', 'phone', 'www', 'timezone', 'prefix', 'suffix', 'name_ext', 'email', 'tax_group', 'merchant_notes', 'account_manager', 'picture']
__init__(*args, **kwargs)[source]
init_fields()[source]
base_fields = {'account_manager': <django.forms.models.ModelChoiceField object>, 'email': <django.forms.fields.EmailField object>, 'is_active': <django.forms.fields.BooleanField object>, 'marketing_permission': <django.forms.fields.BooleanField object>, 'members': <django.forms.models.ModelMultipleChoiceField object>, 'merchant_notes': <django.forms.fields.CharField object>, 'name': <django.forms.fields.CharField object>, 'name_ext': <django.forms.fields.CharField object>, 'phone': <django.forms.fields.CharField object>, 'picture': <filer.fields.image.AdminImageFormField object>, 'prefix': <django.forms.fields.CharField object>, 'suffix': <django.forms.fields.CharField object>, 'tax_group': <django.forms.models.ModelChoiceField object>, 'tax_number': <django.forms.fields.CharField object>, 'timezone': <django.forms.fields.TypedChoiceField object>, 'www': <django.forms.fields.URLField object>}
declared_fields = {}
property media

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

class shuup.admin.modules.contacts.forms.MassEditForm(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 = {'account_manager': <django.forms.models.ModelChoiceField object>, 'gender': <enumfields.forms.EnumChoiceField object>, 'language': <django_countries.fields.LazyTypedChoiceField object>, 'members': <django.forms.models.ModelMultipleChoiceField object>, 'merchant_notes': <django.forms.fields.CharField object>, 'tax_number': <django.forms.fields.CharField object>, 'www': <django.forms.fields.URLField object>}
declared_fields = {'account_manager': <django.forms.models.ModelChoiceField object>, 'gender': <enumfields.forms.EnumChoiceField object>, 'language': <django_countries.fields.LazyTypedChoiceField object>, 'members': <django.forms.models.ModelMultipleChoiceField object>, 'merchant_notes': <django.forms.fields.CharField object>, 'tax_number': <django.forms.fields.CharField object>, 'www': <django.forms.fields.URLField object>}
property media

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

class shuup.admin.modules.contacts.forms.GroupMassEditForm(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 = {'contact_group': <django.forms.models.ModelMultipleChoiceField object>}
declared_fields = {'contact_group': <django.forms.models.ModelMultipleChoiceField object>}
property media

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

shuup.admin.modules.contacts.mass_actions module

class shuup.admin.modules.contacts.mass_actions.EditContactsAction[source]

Bases: PicotableRedirectMassAction

label = 'Edit Contacts'
identifier = 'mass_action_edit_contact'
redirect_url = '/sa/contacts/mass-edit/'
class shuup.admin.modules.contacts.mass_actions.EditContactGroupsAction[source]

Bases: PicotableRedirectMassAction

label = 'Set Contact Groups'
identifier = 'mass_action_edit_contact_group'
redirect_url = '/sa/contacts/mass-edit-group/'
class shuup.admin.modules.contacts.mass_actions.ExportContactsCSVAction[source]

Bases: BaseExportCSVMassAction

identifier = 'mass_action_export_contact_csv'
model

alias of Contact

view_class

alias of ContactListView

filename = 'contacts.csv'

shuup.admin.modules.contacts.sections module

class shuup.admin.modules.contacts.sections.BasicInfoContactSection[source]

Bases: Section

identifier: str = 'contact_basic_info'
name: str | Any = 'Basic Information'
icon: str = 'fa-info-circle'
template: str = 'shuup/admin/contacts/_contact_basic_info.jinja'
order: int = 1
classmethod visible_for_object(contact, request=None)[source]

Returns whether this sections must be visible for the provided object (e.g. order).

:return whether this section must be shown in order section list, defaults to false :rtype: bool

classmethod get_context_data(contact, request=None)[source]

Returns additional information to be used in the template.

To fetch this data in the template, you must first add it to your request’s context

e.g. `context[admin_order_section.identifier] =

admin_order_section.get_context_data(self.object)`

:return additional context data :rtype: object|None

class shuup.admin.modules.contacts.sections.AddressesContactSection[source]

Bases: Section

identifier: str = 'contact_addresses'
name: str | Any = 'Addresses'
icon: str = 'fa-map-marker'
template: str = 'shuup/admin/contacts/_contact_addresses.jinja'
order: int = 2
classmethod visible_for_object(contact, request=None)[source]

Returns whether this sections must be visible for the provided object (e.g. order).

:return whether this section must be shown in order section list, defaults to false :rtype: bool

classmethod get_context_data(contact, request=None)[source]

Returns additional information to be used in the template.

To fetch this data in the template, you must first add it to your request’s context

e.g. `context[admin_order_section.identifier] =

admin_order_section.get_context_data(self.object)`

:return additional context data :rtype: object|None

class shuup.admin.modules.contacts.sections.OrdersContactSection[source]

Bases: Section

identifier: str = 'contact_orders'
name: str | Any = 'Orders'
icon: str = 'fa-inbox'
template: str = 'shuup/admin/contacts/_contact_orders.jinja'
order: int = 3
classmethod visible_for_object(contact, request=None)[source]

Returns whether this sections must be visible for the provided object (e.g. order).

:return whether this section must be shown in order section list, defaults to false :rtype: bool

classmethod get_context_data(contact, request=None)[source]

Returns additional information to be used in the template.

To fetch this data in the template, you must first add it to your request’s context

e.g. `context[admin_order_section.identifier] =

admin_order_section.get_context_data(self.object)`

:return additional context data :rtype: object|None

class shuup.admin.modules.contacts.sections.MembersContactSection[source]

Bases: Section

identifier: str = 'contact_members'
name: str | Any = 'Members'
icon: str = 'fa-user'
template: str = 'shuup/admin/contacts/_contact_members.jinja'
order: int = 4
classmethod visible_for_object(contact, request=None)[source]

Returns whether this sections must be visible for the provided object (e.g. order).

:return whether this section must be shown in order section list, defaults to false :rtype: bool

classmethod get_context_data(contact, request=None)[source]

Returns additional information to be used in the template.

To fetch this data in the template, you must first add it to your request’s context

e.g. `context[admin_order_section.identifier] =

admin_order_section.get_context_data(self.object)`

:return additional context data :rtype: object|None

shuup.admin.modules.contacts.utils module

shuup.admin.modules.contacts.utils.request_limited(request)[source]
shuup.admin.modules.contacts.utils.check_contact_permission(request, contact)[source]

Module contents

class shuup.admin.modules.contacts.ContactModule[source]

Bases: AdminModule

name = 'Contacts'
breadcrumbs_menu_entry = <shuup.admin.base.MenuEntry object>
get_urls()[source]
Return type:

list[django.urls.RegexURLPattern]

get_menu_entries(request)[source]
Return type:

list[shuup.admin.base.MenuEntry]

get_search_results(request, query)[source]
Return type:

list[shuup.admin.base.SearchResult]

get_model_url(object, kind, shop=None)[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:
Returns:

The reversed URL or none.

Return type:

str|None

get_extra_permissions() Iterable[str][source]

Define custom extra permissions for admin module for option to limit certain parts of the admin module based on per user permission string. Should return unique list permission strings across the installation to prevent unwanted side effects.

Return type:

list[str]

get_permissions_help_texts() Iterable[str][source]

Returns a dictionary where the keys is the permission identifier and the value is a help text that can help the user to understand where the permissions is used and how it works.