The problem with form errors is that this is not the ErrorList, but
the ErrorDict.

Two problems with this, ErrorDict has no way to find out what the
label of the field is and a ErrorDict subclass cannot be passed in to
the form like Errorlist using error_class.

Should ErrorDict be passed a tuple, (fileld.label, e.messages) instead
of just e.messages as it currently does?

http://code.djangoproject.com/browser/django/trunk/django/newforms/forms.py#L212

Should it be possible to pass in ErrorDict too changing error_class to
error_list and adding error_dict?

On Mar 5, 12:29 pm, Malcolm Tredinnick <[EMAIL PROTECTED]>
wrote:
> On Tue, 2008-03-04 at 12:59 -0600, James Bennett wrote:
> > Ticket #6705 [1] proposes that 'form.errors' be changed to somehow
> > provide a "prettier" display not based on the underlying field name
> > (which is currently used as the key in the errors dictionary).
>
> > The person who opened this ticket contends that it is a common issue,
> > and that there is no existing way to work around the desire to simply
> > do '{{ form.errors }}' in a ticket and have it display as he desires.
>
> Given that the unicode() form of ErrorList is apparently intended as a
> string that is intended to be inserted directly into an HTML form, I
> suspect the submitter has a valid request. The form field label should
> be used as the default display name for a field attribute, when it
> exists and ErrorList.__unicode__() (which is ErrorList.as_ul()) seems to
> be intended as something for display output.
>
> It's by no means a showstopper, since subclassing is a pretty easy
> option to change this, but, on balance, using the field label is
> probably the more natural thing there. My thinking here is that it's
> never going to be wrong to use the field display name, when it exists,
> in a case like this.
>
> Malcolm
>
> --
> Why can't you be a non-conformist like everyone 
> else?http://www.pointy-stick.com/blog/
--~--~---------~--~----~------------~-------~--~----~
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?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to