Ticket #9906: 9906.diff
File 9906.diff, 738 bytes (added by , 16 years ago) |
---|
-
docs/ref/forms/fields.txt
173 173 >>> f.errors 174 174 {'url': [u'This field is required.'], 'name': [u'This field is required.']} 175 175 176 Instead of a constant, you can also pass any callable:: 177 178 >>> import datetime 179 >>> class DateForm(forms.Form): 180 ... day = forms.DateField(initial=datetime.date.today) 181 >>> print DateForm() 182 <tr><th>Day:</th><td><input type="text" name="day" value="12/23/2008" /><td></tr> 183 184 The callable will be evaluted only when the unbound form is displayed, not when it is defined. 185 176 186 ``widget`` 177 187 ~~~~~~~~~~ 178 188