Ticket #4593: unicode.newforms.a.patch

File unicode.newforms.a.patch, 1005 bytes (added by Bjorn Swift <bjorn.swift@…>, 17 years ago)

Encode label in _html_output using smart_unicode

  • forms.py

     
    66
    77from django.utils.datastructures import SortedDict
    88from django.utils.html import escape
    9 from django.utils.encoding import StrAndUnicode
     9from django.utils.encoding import StrAndUnicode, smart_unicode
    1010
    1111from fields import Field
    1212from widgets import TextInput, Textarea
     
    136136                    help_text = help_text_html % field.help_text
    137137                else:
    138138                    help_text = u''
    139                 output.append(normal_row % {'errors': bf_errors, 'label': label, 'field': unicode(bf), 'help_text': help_text})
     139                output.append(normal_row % {'errors': bf_errors, 'label': smart_unicode(label), 'field': unicode(bf), 'help_text': help_text})
    140140        if top_errors:
    141141            output.insert(0, error_row % top_errors)
    142142        if hidden_fields: # Insert any hidden fields in the last row.
Back to Top