Jacob Kaplan-Moss wrote:
> On Aug 25, 2006, at 7:04 AM, DavidA wrote:
> > One comment on ValidationErrors: When I've done these types of things
> > in the past, I've typically returned two levels of validations
> > messages: warnings and errors. An error indicates that the attempted
> > save will fail (i.e. it would either cause a an object to be saved in
> > an invalid state or it would violate a DB constraint and throw an
> > exception in the backend). A warning would not result in a failure but
> > is still worthy of notifying the user, but there are cases where
> > its OK
> > so its not identified as an error.
>
> Yes! This is something that I forgot about -- we've wanted to add
> validation warnings to Django as long as I can remember.
>
> > So I'd suggest a ValidationException that has an errors dict, a
> > warnings dict and possibly a form (or a very easy way to create a form
> > from the exception).

I would also love to see a way to throw a validation error at the
form/manipulator level that would short circuit further validation at
the field level.  For example, I have a login form and want to attach a
hasCookiesEnabled validator at the manipulator level so that if the
user didn't have cookies enabled, further validation would be skipped
(saving hits to my authentication server and database server) and a
manipulator level error would be raised.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@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-developers
-~----------~----~----~----~------~----~------~--~---

Reply via email to