#19592: BaseForms validation and ValidationError's params
-----------------------------+--------------------
Reporter: cgenie@… | Owner: nobody
Type: New feature | Status: new
Component: Forms | Version: 1.4
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------+--------------------
In forms/forms.py the _clean_fields function of BaseForm waits for
ValidationError exception and inserts e.messages to self._errors.
The problem is that ValidationError supports quite useful things, like
params, understanding dict arguments, etc. Since forms/forms.py takes only
e.messages, there's no way to access later these parameters.
Would this make a reasonable request for improvement of BaseForms: instead
of using e.messages, wrap the returned exception into some object, whose
__unicode__ method returns e.messages (to preserve compatibility), with
additional properties taken from ValidationError.params?
This would allow for fine-grained error reporting. Not only would we have
error messages reported per field, but could also specify additional
parameters in the error message.
--
Ticket URL: <https://code.djangoproject.com/ticket/19592>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" 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 https://groups.google.com/groups/opt_out.