2
Fetch the values from form.cleaned_data
, instead of using form['fieldname'].data
For example:
date = form.cleaned_data['date']
See the docs on processing the data from a form for further details.
0
There might be more than one problem, but the most obvious one that stands out is this:
price = modes.FloatField(..., blank=False, ...)
in your Session model.
Set blank=True to allow the form field to be blank. The ORM will then use your default=0 when saving if the form field was blank.
- [Answered ]-Deploy with Apache2, mod_wgi and django 1.9 on ubuntu server 16.04
- [Answered ]-Nested GROUP BY in django: returning Objects
- [Answered ]-Django REST Updateview with PUT POST
Source:stackexchange.com