On Sun, Jul 13, 2008 at 8:20 AM, Torsten Bronger <
[EMAIL PROTECTED]> wrote:

>
> Hallöchen!
>
> While ModelForm.is_valid() finds field validation errors, it cannot
> catch errors in uniqueness or referential integrity as far as I can
> see.  Thus, I have to check them in my view.py code separately
> before calling save().
>
> If such errors are detected, I'd like to display them the same way
> as the other validation errors are displayed.  Is it possible to
> inject additional errors into a form?  Or are there better ways to
> detect and report "inter-form" errors?
>

Ticket #7444  (http://code.djangoproject.com/ticket/7444) requests an
official API to support this; in the meantime it also illustrates the method
that works now -- just access the _errors dictionary directly.  I have a
feeling this has come up a few times and the answer has been "we don't need
an official API, just access _errors", but I could be misremembering and
don't have time at the moment to research it.

Karen

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

Reply via email to