shoop.default_tax package

Submodules

shoop.default_tax.models module

class shoop.default_tax.models.TaxRuleQuerySet(model=None, query=None, using=None, hints=None)[source]

Bases: django.db.models.query.QuerySet

may_match_postal_code(postalcode)[source]
class shoop.default_tax.models.TaxRule(id, enabled, country_codes_pattern, region_codes_pattern, postal_codes_pattern, _postal_codes_min, _postal_codes_max, priority, override_group, tax)[source]

Bases: django.db.models.base.Model

tax_classes
customer_tax_groups
tax
objects = <django.db.models.manager.ManagerFromTaxRuleQuerySet object>
matches(taxing_context)[source]

Check if this tax rule matches given taxing context.

save(*args, **kwargs)[source]
exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception TaxRule.MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

shoop.default_tax.module module

class shoop.default_tax.module.DefaultTaxModule[source]

Bases: shoop.core.taxing.TaxModule

identifier = 'default_tax'
name = <django.utils.functional.lazy.<locals>.__proxy__ object>
get_taxed_price(context, price, tax_class)[source]
shoop.default_tax.module.get_taxes_of_effective_rules(taxing_context, tax_rules)[source]

Get taxes grouped by priority from effective tax rules.

Effective tax rules is determined by first limiting the scope to the rules that match the given taxing context (see TaxRule.match) and then further limiting the matching rules by selecting only the rules in the highest numbered override group.

The Tax objects in the effective rules will be grouped by the priority of the rules. The tax groups are returned as list of tax lists.

Parameters:tax_rules (Iterable[TaxRule]) – Tax rules to filter from. These should be ordered desceding by override group and then ascending by priority.
Return type:list[list[shoop.core.models.Tax]]

Module contents

class shoop.default_tax.AppConfig(*args, **kwargs)[source]

Bases: shoop.apps.AppConfig

name = 'shoop.default_tax'
verbose_name = <django.utils.functional.lazy.<locals>.__proxy__ object>
label = 'default_tax'
provides = {'tax_module': ['shoop.default_tax.module:DefaultTaxModule'], 'admin_module': ['shoop.default_tax.admin_module:TaxRulesAdminModule']}