On Wed, 2007-05-23 at 10:16 -0700, mario wrote:
> I'm using newforms library and it is really a great improvement over
> "oldforms".
> 
> However, how would I report more than a single error when doing cross-
> field validation in the form clean() method?
> 
> I mean, since the errors are reported by raising an exception, on the
> first raised validation error the clean() method stops validating.
> Thus the user will only see the first error in the form. He has to fix
> it and resubmit to see (if any) the next errors.

Your form-level clean method should run through all of its validation,
collecting the errors as it goes and then raise a ValidationError. Note
that ValidationError can take a list of error messages in its
constructor, so just collect all your errors into a list and pass them
all at once to a single ValidationError raiser.

Regards,
Malcolm



--~--~---------~--~----~------------~-------~--~----~
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