Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

prices.py 725B

123456789101112131415161718192021222324
  1. class TaxNotKnown(Exception):
  2. """
  3. Exception for when a tax-inclusive price is requested but we don't know
  4. what the tax applicable is (yet).
  5. """
  6. class Price(object):
  7. is_tax_known = False
  8. def __init__(self, currency, excl_tax, incl_tax=None, tax=None):
  9. """
  10. You can either pass the price including tax or simply the tax
  11. """
  12. self.currency = currency
  13. self.excl_tax = excl_tax
  14. if incl_tax is not None:
  15. self.incl_tax = incl_tax
  16. self.is_tax_known = True
  17. self.tax = incl_tax - excl_tax
  18. elif tax is not None:
  19. self.incl_tax = excl_tax + tax
  20. self.is_tax_known = True
  21. self.tax = tax