shuup.default_tax.admin_module package
Submodules
shuup.default_tax.admin_module.views module
- class shuup.default_tax.admin_module.views.TaxRuleForm(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, instance=None, use_required_attribute=None, renderer=None)[source]
Bases:
ModelForm
- class Meta[source]
Bases:
object
- fields = ['tax_classes', 'customer_tax_groups', 'country_codes_pattern', 'region_codes_pattern', 'postal_codes_pattern', 'priority', 'override_group', 'tax', 'enabled']
- help_texts = {'country_codes_pattern': 'Comma-separated values or ranges, e.g. A-Z,10000-19000. Use exclamation marks to negate (A-Z,!G will not match G).', 'postal_codes_pattern': 'Comma-separated values or ranges, e.g. A-Z,10000-19000. Use exclamation marks to negate (A-Z,!G will not match G).', 'region_codes_pattern': 'Comma-separated values or ranges, e.g. A-Z,10000-19000. Use exclamation marks to negate (A-Z,!G will not match G).'}
- clean()[source]
Hook for doing any extra form-wide cleaning after Field.clean() has been called on every field. Any ValidationError raised by this method will not be associated with a particular field; it will have a special-case association with the field named ‘__all__’.
- base_fields = {'country_codes_pattern': <django.forms.fields.CharField object>, 'customer_tax_groups': <django.forms.models.ModelMultipleChoiceField object>, 'enabled': <django.forms.fields.BooleanField object>, 'override_group': <django.forms.fields.IntegerField object>, 'postal_codes_pattern': <django.forms.fields.CharField object>, 'priority': <django.forms.fields.IntegerField object>, 'region_codes_pattern': <django.forms.fields.CharField object>, 'tax': <django.forms.models.ModelChoiceField object>, 'tax_classes': <django.forms.models.ModelMultipleChoiceField object>}
- declared_fields = {}
- property media
Return all media required to render the widgets on this form.
- class shuup.default_tax.admin_module.views.TaxRuleEditView(**kwargs)[source]
Bases:
CreateOrUpdateView
Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.
- template_name = 'shuup/default_tax/admin/edit.jinja'
- form_class
alias of
TaxRuleForm
- context_object_name = 'tax_rule'
- add_form_errors_as_messages = True
- class shuup.default_tax.admin_module.views.TaxRuleListView[source]
Bases:
PicotableListView
- url_identifier = 'default_tax.tax_rule'
- default_columns = [<Column: Tax Rule> id, <Column: Tax> tax, <Column: Tax Classes> tax_classes, <Column: Customer Tax Groups> customer_tax_groups, <Column: Countries> country_codes_pattern, <Column: Regions> region_codes_pattern, <Column: Postal Codes> postal_codes_pattern, <Column: Priority> priority, <Column: Override Group> override_group, <Column: Enabled> enabled]
Module contents
- class shuup.default_tax.admin_module.TaxRulesAdminModule[source]
Bases:
AdminModule
- name = 'Tax Rules'
- 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