shuup.admin.modules.attributes package

Subpackages

Submodules

shuup.admin.modules.attributes.form_parts module

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

Bases: FormPart

priority: int = 1
get_form_defs()[source]
form_valid(form)[source]
class shuup.admin.modules.attributes.form_parts.AttributeChoiceOptionsFormPart(request, object=None)[source]

Bases: FormPart

name = 'choice_options'
priority: int = 2
formset

alias of AttributeChoiceOptionFormSet

get_form_defs()[source]
form_valid(form)[source]

shuup.admin.modules.attributes.forms module

class shuup.admin.modules.attributes.forms.AttributeForm(*args, **kwargs)[source]

Bases: MultiLanguageModelForm

class Meta[source]

Bases: object

model

alias of Attribute

fields = '__all__'
__init__(*args, **kwargs)[source]
clean()[source]

Avoid partially translated languages where the translated fields that are required are not set.

base_fields = {'identifier': <django.forms.fields.CharField object>, 'max_choices': <django.forms.fields.IntegerField object>, 'min_choices': <django.forms.fields.IntegerField object>, 'name': <django.forms.fields.CharField object>, 'ordering': <django.forms.fields.IntegerField object>, 'searchable': <django.forms.fields.BooleanField object>, 'type': <enumfields.forms.EnumChoiceField object>, 'visibility_mode': <enumfields.forms.EnumChoiceField object>}
declared_fields = {'name': <django.forms.fields.CharField object>}
property media

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

class shuup.admin.modules.attributes.forms.AttributeChoiceOptionForm(*args, **kwargs)[source]

Bases: MultiLanguageModelForm

class Meta[source]

Bases: object

model

alias of AttributeChoiceOption

fields = ('name',)
__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 = {'name': <django.forms.fields.CharField object>}
declared_fields = {'name': <django.forms.fields.CharField object>}
property media

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

class shuup.admin.modules.attributes.forms.AttributeChoiceOptionFormSet(**kwargs)[source]

Bases: BaseModelFormSet

model

alias of AttributeChoiceOption

form_class

alias of AttributeChoiceOptionForm

validate_min = False
min_num = 0
validate_max = False
max_num = 100
absolute_max = 100
can_delete = True
can_order = False
extra = 0
property can_delete_extra

Compatibility property for Django formsets.

__init__(**kwargs)[source]
form(**kwargs)[source]
get_queryset()[source]

Module contents

class shuup.admin.modules.attributes.AttributeModule[source]

Bases: AdminModule

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

list[django.urls.RegexURLPattern]

get_menu_category_icons()[source]
Return type:

dict[str,str]

get_menu_entries(request)[source]
Return type:

list[shuup.admin.base.MenuEntry]

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.