Ticket #4593: unicode.newforms.b.patch
File unicode.newforms.b.patch, 851 bytes (added by , 17 years ago) |
---|
-
forms.py
6 6 7 7 from django.utils.datastructures import SortedDict 8 8 from django.utils.html import escape 9 from django.utils.encoding import StrAndUnicode 9 from django.utils.encoding import StrAndUnicode, smart_unicode 10 10 11 11 from fields import Field 12 12 from widgets import TextInput, Textarea … … 300 300 id_ = widget.attrs.get('id') or self.auto_id 301 301 if id_: 302 302 attrs = attrs and flatatt(attrs) or '' 303 contents = '<label for="%s"%s>%s</label>' % (widget.id_for_label(id_), attrs, contents)303 contents = '<label for="%s"%s>%s</label>' % (widget.id_for_label(id_), attrs, smart_unicode(contents)) 304 304 return contents 305 305 306 306 def _is_hidden(self):