Changeset 6266
- Timestamp:
- 09/15/07 00:50:45 (1 year ago)
- Files:
-
- django/trunk/django/newforms/util.py (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/trunk/django/newforms/util.py
r6140 r6266 1 1 from django.utils.html import escape 2 from django.utils.encoding import smart_unicode, StrAndUnicode 2 from django.utils.encoding import smart_unicode, StrAndUnicode, force_unicode 3 3 from django.utils.functional import Promise 4 4 … … 23 23 def as_ul(self): 24 24 if not self: return u'' 25 return u'<ul class="errorlist">%s</ul>' % ''.join([u'<li>%s%s</li>' % (k, smart_unicode(v)) for k, v in self.items()])25 return u'<ul class="errorlist">%s</ul>' % ''.join([u'<li>%s%s</li>' % (k, force_unicode(v)) for k, v in self.items()]) 26 26 27 27 def as_text(self): 28 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()])28 return u'\n'.join([u'* %s\n%s' % (k, u'\n'.join([u' * %s' % force_unicode(i) for i in v])) for k, v in self.items()]) 29 29 30 30 class ErrorList(list, StrAndUnicode): … … 37 37 def as_ul(self): 38 38 if not self: return u'' 39 return u'<ul class="errorlist">%s</ul>' % ''.join([u'<li>%s</li>' % smart_unicode(e) for e in self])39 return u'<ul class="errorlist">%s</ul>' % ''.join([u'<li>%s</li>' % force_unicode(e) for e in self]) 40 40 41 41 def as_text(self): 42 42 if not self: return u'' 43 return u'\n'.join([u'* %s' % smart_unicode(e) for e in self])43 return u'\n'.join([u'* %s' % force_unicode(e) for e in self]) 44 44 45 45 class ValidationError(Exception): … … 59 59 # See http://www.python.org/doc/current/tut/node10.html#handling 60 60 return repr(self.messages) 61
