Hi all,
I followed the instructions here (http://docs.djangoproject.com/en/dev/
ref/forms/api/#customizing-the-error-list-format), on how to customize
the error list format:
class TipErrorList(ErrorList):
def __unicode__(self):
return self.as_tips()
def as_tips(self):
if not self: return u''
return u'<span class="field-error" title="%s"></span>' %
','.join(e for e in self)
class RegistrationForm(UserCreationForm):
def __init__(self, *args, **kwargs):
super(RegistrationForm, self).__init__
(error_class=TipErrorList, *args, **kwargs)
I'm still getting a ErrorList instead of a my class.
Is this supposed to work? I can't understand what I'm doing wrong.
I'm trying to avoid doing a for loop for each field in the template.
using django 1.0.2
Regards.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---