Ticket #4387: newformsutils-printerrordict.diff

File newformsutils-printerrordict.diff, 778 bytes (added by Thomas Güttler <hv@…>, 17 years ago)
  • django/newforms/util.py

     
    2121
    2222    def as_ul(self):
    2323        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       
    2529
    2630    def as_text(self):
    2731        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()])
Back to Top