Ticket #3506: help_text.patch
File help_text.patch, 1.0 KB (added by , 18 years ago) |
---|
-
django/newforms/forms.py
218 218 self.label = pretty_name(name) 219 219 else: 220 220 self.label = self.field.label 221 self.help_text = field.help_text 221 self.help_text = field.help_text or '' 222 222 223 223 def __unicode__(self): 224 224 "Renders this field as an HTML widget." -
tests/regressiontests/forms/tests.py
3044 3044 <p>Password2: <input type="password" name="password2" /></p> 3045 3045 <input type="submit" /> 3046 3046 </form> 3047 >>> Template('{{ form.password1.help_text }}').render(Context({'form': UserRegistration(auto_id=False)})) 3048 '' 3047 3049 3048 3050 The label_tag() method takes an optional attrs argument: a dictionary of HTML 3049 3051 attributes to add to the <label> tag.