Reputation: 2162
One of my forms is failing, and I want to know why.
if formset.is_valid() and formset.has_changed():
formset.save()
else:
# do something.
What can I print or see from formset on the else part to see what the problem was?
Thanks!
Upvotes: 0
Views: 111
Reputation: 99640
It is simpler than you think it is. Just use formset.errors
if formset.is_valid() and formset.has_changed():
formset.save()
else:
print formset.errors
Also, you might want to consider rendering the erroneous form to the template, so the browser can display the errors in the formset.
Upvotes: 1