{"repo":"mirumee/django-prices","free":true,"listed":false,"github":"https://github.com/mirumee/django-prices","clone":"git clone https://github.com/mirumee/django-prices.git","description":"Django fields for the prices module","language":"Python","stars":158,"topics":["python","price","money","currency","currencies","django"],"license":"BSD-3-Clause","category":"api-integrations-sdks","readme_excerpt":"django-prices: Django fields for the prices module ==================================================== Installation pip install django-prices Add django prices to your INSTALLED APPS at settings.py Features Provides support for models: And forms: And validators: It also provides support for templates: You can also use HTML output from prices template tags, they will wrap currency symbol in a element: It will be rendered as a following structure (for example with English locale): How to migrate to django-prices 2.0 Version 2.0 introduces major changes to how prices data is stored in models, enabling setting price's currency per model instance. Steps to migrate: 1. In your forms : remove the currency argument add available currencies with available choices. If the form specified MoneyFields in fields option, replace those with explicit declarations instead: 1. In your models using MoneyField : Replace all occurrences of the MoneyField class with DecimalField Remove the currency argument from them Change default from Money instance to value acceptable by Decimal field Example of code: Updated code: 1. In your migration files: Replace all occurrences of the MoneyField class with DecimalField Remove the currency argument from them Change default from Money instance to value acceptable by Decimal field Updated code: 1. Rename fields in models . Your old field will still store amount of money, so probably the best choice would be price net amount instead price net . 1. All places w","default_branch":null,"files":null,"tree":[],"storefront":"/r/mirumee","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/mirumee/django-prices/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}