I am using modelForm to make a form for my Brew model. The form shows
up and works fine. And saves it when I call save. But it does not
catch the errors correctly. I set it up mostly based on this example:

from django.core.validators import ValidationError, NON_FIELD_ERRORS
try:
    article.full_clean()
except ValidationError, e:
    non_field_errors = e.message_dict[NON_FIELD_ERRORS]


First of all, NON_FIELD_ERRORS was unknown to django and caused an
error.

What I really want is to see a full code example of how to do this
seemingly simple thing. Just a form from a model that allows users to
create a new instance of the model and save it to the database. And
how the errors are dealt with. Please help, I swear I have looked all
through the docs.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to