Ticket #4593: unicode.newforms.c.patch
File unicode.newforms.c.patch, 1.3 KB (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 … … 133 133 else: 134 134 label = '' 135 135 if field.help_text: 136 help_text = help_text_html % field.help_text136 help_text = help_text_html % smart_unicode(escape(field.help_text)) 137 137 else: 138 138 help_text = u'' 139 139 output.append(normal_row % {'errors': bf_errors, 'label': label, 'field': unicode(bf), 'help_text': help_text}) … … 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):