On Aug 24, 12:25 pm, "Tim Kersten" <[EMAIL PROTECTED]> wrote:
> Ah, I see what you mean. A quick glance
> athttp://code.djangoproject.com/changeset/4544
> tell's me this is not possible to do so inside the error message, for
> good reasons. To style your message take a look at
>
> http://www.djangoproject.com/documentation/forms/#how-errors-are-disp...
> andhttp://www.djangoproject.com/documentation/forms/#customizing-the-err...
>
> Hope this helps,
Ok thanks! - this clears things up at least! :-)
I see a lot of good reasons for autoescaping all error messages, but
it should be possible to override.
I'd like to include a error message in my form with a link to a help
page.
I could make my own class for displaying errors, but the error
messages are already escaped when I get them. I would have to
manually unescape the error message again, perhaps like this:
class HtmlErrorList(ErrorList):
def __unicode__(self):
return u'<ul>%s</ul>' % ''.join([u'<li>%s</li>' % unescape(e)
for e in self])
This however would cause all error messages in the form to be
unescaped, something I wouldn't want.
I wonder why custom error messages are considered more dangerous than
the help_text in the same form?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" 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-users?hl=en
-~----------~----~----~----~------~----~------~--~---