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 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.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9ab285645a8f6b8c86754a6bac1b6319da1cf6f674e136b5f317c7eb0df534cd |
|
MD5 | c901f18f0d0568c579b33e33783fae04 |
|
BLAKE2b-256 | de08afa0111c23cdcb6a48d157c6960da360a213497517a6890ebd3992fc48db |