1๐
โ
You need to check if both forms are valid before performing any action on the data AND only redirect if both forms are valid. This:
if new_customer.is_valid():
a = new_customer.save()
if new_inovce.is_valid():
...
return HttpResponseRedirect('/novi_izlazni_racuni/')
Should be this:
valid = new_customer.is_valid()
valid = new_inovce.is_valid() and valid
if valid:
a = new_customer.save()
...
return HttpResponseRedirect('/novi_izlazni_racuni/')
This forces both forms to be validated
๐คIain Shelvington
0๐
I think here is the answer to your question:
https://docs.djangoproject.com/en/1.8/ref/forms/api/#django.forms.Form.prefix
๐คshalakhin
- [Answer]-How to run Django views from a script?
- [Answer]-How to get the page based on the selection in a drop down list in Django
- [Answer]-Ugly Django error: column hello_match.URL does not exist
Source:stackexchange.com