2👍
In your views.py:
- formset = DepositFormSet(initial=formset.cleaned_data)
+ data = formset.cleaned_data
+ if data[-1]=={}:
+ data=data[:-1]
+ formset = DepositFormSet(initial=data)
It looks pretty much like a feature than like a bug 😉
1👍
I’ve not done this myself, but if you wanted to actually make it invalid with a blank entry, perhaps you’d consider putting it in the clean method:
http://docs.djangoproject.com/en/dev/topics/forms/formsets/#custom-formset-validation
- [Django]-Django Multiple Levels Choices for Field
- [Django]-Fabric: unable to get environment variables within virtualenv
- [Django]-Safely rendering user provided django templates
- [Django]-How to get a property from a Django model?
Source:stackexchange.com