Quoting problem statement from #6652:

"Currently the Form.clean() method has no way to specify which field
is invalid, but it's the only place where validation involving many
fields can be accomplished. Taking your example in the documentation:

This is where you might put in things to check that if field A is
supplied, field B must contain a valid email address and the like.

If the field B doesn't contain a valid email address, the error
message should appear next to the B widget, not at the top of the
form.

An easy fix is to add a 'field_name' optional attribute to the
ValidationError and use it if provided."

The consensus after discussions at #6652 is that it is needed, with
the following caveat:

"Given the currently active discussion on django-dev regarding changes
to model and form validation (including some renaming), let's sit on
this for a bit."

Give your opinions please.

The ticket has a simple patch with thorough tests and documentation,
it's a low hanging fruit ready for checkin and would help many people
(who mostly solve this by accessing _errors directly -- which is not
good as it relies on an implementation detail and is less clean).
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to