shuup.admin.modules.attributes package
Subpackages
Submodules
shuup.admin.modules.attributes.form_parts module
shuup.admin.modules.attributes.forms module
- class shuup.admin.modules.attributes.forms.AttributeForm(*args, **kwargs)[source]
Bases:
MultiLanguageModelForm
- 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
- 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.
Module contents
- class shuup.admin.modules.attributes.AttributeModule[source]
Bases:
AdminModule
- name = 'Attributes'
- Return type:
- 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:
object (django.db.models.Model) – A object instance (or object class).
kind (str) – URL kind. Currently “detail”, “list” or “new”.
shop (shuup.core.models.Shop|None) – The shop that owns the resource.
- Returns:
The reversed URL or none.
- Return type:
str|None