Changeset 8761
- Timestamp:
- 08/31/08 06:39:06 (3 months ago)
- Files:
-
- django/trunk/django/forms/forms.py (modified) (1 diff)
- django/trunk/tests/regressiontests/forms/regressions.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/trunk/django/forms/forms.py
r7971 r8761 375 375 if id_: 376 376 attrs = attrs and flatatt(attrs) or '' 377 contents = '<label for="%s"%s>%s</label>' % (widget.id_for_label(id_), attrs, contents)377 contents = u'<label for="%s"%s>%s</label>' % (widget.id_for_label(id_), attrs, unicode(contents)) 378 378 return mark_safe(contents) 379 379 django/trunk/tests/regressiontests/forms/regressions.py
r7971 r8761 34 34 u'<p><label for="id_username">Nazwa u\u017cytkownika:</label> <input id="id_username" type="text" name="username" maxlength="10" /></p>' 35 35 >>> deactivate() 36 37 There was some problems with form translations in #5216 38 >>> class SomeForm(Form): 39 ... field_1 = CharField(max_length=10, label=ugettext_lazy('field_1')) 40 ... field_2 = CharField(max_length=10, label=ugettext_lazy('field_2'), widget=TextInput(attrs={'id': 'field_2_id'})) 41 >>> f = SomeForm() 42 >>> print f['field_1'].label_tag() 43 <label for="id_field_1">field_1</label> 44 >>> print f['field_2'].label_tag() 45 <label for="field_2_id">field_2</label> 36 46 37 47 Unicode decoding problems...
