A Django app to make simple calculations in your django forms
Project description
django-calculation
Make simple calculations in your django forms.
Installation
pip install git+https://github.com/blasferna/django-calculation.git#egg=django-calculation
Add calculation
to your INSTALLED_APPS
INSTALLED_APPS = [
...
'calculation',
]
Usage
Import NumericCalculationInput
from calculation.widgets
and complete the calculation
attribute like this.
from django import forms
from calculation.widgets import NumericCalculationInput
class TestForm(forms.Form):
quantity = forms.DecimalField()
price = forms.DecimalField()
amount = forms.DecimalField(
widget=NumericCalculationInput(
attrs={
'calculation': {
'mode': NumericCalculationInput.FORMULA,
'formula': 'quantity*price'
}
}
)
)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for django_calculation-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 14e4dfe226d5a6557b93b0e7e45e6b951abc7fbf08e97ea5c17bb7d2d7005af1 |
|
MD5 | b681f87b30a29bfedc2557f6b8356ba2 |
|
BLAKE2b-256 | a31baa15e6a03a1d8fd5cfac77c8a4a8b1aab73b19aac0e8bcbaf29ea0a8a743 |