Ticket #4387: newformsutils-printerrordict.diff
File newformsutils-printerrordict.diff, 778 bytes (added by , 17 years ago) |
---|
-
django/newforms/util.py
21 21 22 22 def as_ul(self): 23 23 if not self: return u'' 24 return u'<ul class="errorlist">%s</ul>' % ''.join([u'<li>%s%s</li>' % (k, smart_unicode(v)) for k, v in self.items()]) 24 listitems=[] 25 for k, v in self.items(): 26 listitems.append(u'<li>%s %s</li>' % (k, u' '.join([smart_unicode(i) for i in v]))) 27 return u'<ul class="errorlist">%s</ul>' % ''.join(listitems) 28 25 29 26 30 def as_text(self): 27 31 return u'\n'.join([u'* %s\n%s' % (k, u'\n'.join([u' * %s' % smart_unicode(i) for i in v])) for k, v in self.items()])