Changeset 4223
- Timestamp:
- 12/17/06 13:04:03 (2 years ago)
- Files:
-
- django/trunk/django/newforms/fields.py (modified) (1 diff)
- django/trunk/tests/regressiontests/forms/tests.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/trunk/django/newforms/fields.py
r4218 r4223 35 35 36 36 def __init__(self, required=True, widget=None, label=None): 37 if label is not None: 38 label = smart_unicode(label) 37 39 self.required, self.label = required, label 38 40 widget = widget or self.widget django/trunk/tests/regressiontests/forms/tests.py
r4218 r4223 2063 2063 <li>Password (again): <input type="password" name="password2" /></li> 2064 2064 2065 A label can be a Unicode object or a bytestring with special characters. 2066 >>> class UserRegistration(Form): 2067 ... username = CharField(max_length=10, label='ŠĐĆŽćžšđ') 2068 ... password = CharField(widget=PasswordInput, label=u'\u0160\u0110\u0106\u017d\u0107\u017e\u0161\u0111') 2069 >>> p = UserRegistration(auto_id=False) 2070 >>> p.as_ul() 2071 u'<li>\u0160\u0110\u0106\u017d\u0107\u017e\u0161\u0111: <input type="text" name="username" maxlength="10" /></li>\n<li>\u0160\u0110\u0106\u017d\u0107\u017e\u0161\u0111: <input type="password" name="password" /></li>' 2072 2065 2073 # Forms with prefixes ######################################################### 2066 2074
