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.
Personally I'm of the opinion that granular error output and
customizable error classes, though not precisely the solution asked
for in this ticket, provide adequate options at both ends of the
spectrum (granular output for fine-grained form display, custom error
classes for the simple case of printing a form), but the submitter has
repeatedly reopened the ticket and asked for broader consideration.
Since the submitter has not followed repeated advice/trout-slapping to
the effect that this list is a better discussion medium, I'm bringing
it up on his behalf.
Thoughts?
[1] http://code.djangoproject.com/ticket/6705
--
"Bureaucrat Conrad, you are technically correct -- the best kind of correct."
he cant do something like http://dpaste.com/38006/ ?
Should probably be field.label instead of field.label_tag, no? :)
--
Collin Grady
"I don't think so," said Descartes. Just then, he vanished.
The desired case is for {{ form.errors }} to somehow do something
similar, but automatically.
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/