Changeset 4924
- Timestamp:
- 04/04/07 08:52:35 (2 years ago)
- Files:
-
- django/trunk/django/newforms/forms.py (modified) (2 diffs)
- django/trunk/tests/regressiontests/forms/regressions.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/trunk/django/newforms/forms.py
r4918 r4924 6 6 from django.utils.html import escape 7 7 from django.utils.encoding import StrAndUnicode 8 from django.conf import settings 8 9 from fields import Field 9 10 from widgets import TextInput, Textarea, HiddenInput, MultipleHiddenInput … … 231 232 # "special" object rather than a string. Call the __str__() on that 232 233 # object to get its rendered value. 233 value = value.__ str__()234 value = value.__unicode__() 234 235 return value 235 236 django/trunk/tests/regressiontests/forms/regressions.py
r4904 r4924 12 12 u'<p>F1: <input type="text" class="special" name="f1" maxlength="10" /></p>\n<p>F2: <input type="text" class="special" name="f2" /></p>' 13 13 14 ####################### 15 # Tests for form i18n # 16 ####################### 14 ####################### 15 # Tests for form i18n # 16 ####################### 17 17 There were some problems with form translations in #3600 18 18 19 19 >>> from django.utils.translation import gettext_lazy, activate, deactivate 20 20 >>> class SomeForm(Form): … … 27 27 <p><label for="id_username">Benutzername:</label> <input id="id_username" type="text" name="username" maxlength="10" /></p> 28 28 >>> deactivate() 29 30 Unicode decoding problems... 31 >>> GENDERS = (('0', u'En tied\xe4'), ('1', u'Mies'), ('2', u'Nainen')) 32 >>> class SomeForm(Form): 33 ... somechoice = ChoiceField(choices=GENDERS, widget=RadioSelect()) 34 >>> f = SomeForm() 35 >>> f.as_p() 36 u'<p><label for="id_somechoice_0">Somechoice:</label> <ul>\n<li><label><input type="radio" id="id_somechoice_0" value="0" name="somechoice" /> En tied\xe4</label></li>\n<li><label><input type="radio" id="id_somechoice_1" value="1" name="somechoice" /> Mies</label></li>\n<li><label><input type="radio" id="id_somechoice_2" value="2" name="somechoice" /> Nainen</label></li>\n</ul></p>' 29 37 """
