diff options
| author | Guillaume Pannatier <guillaume.pannatier@gmail.com> | 2014-05-23 09:07:15 +0200 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2014-05-28 13:23:28 -0400 |
| commit | 32586b0ba43816d325be0ce807f75623683eed7a (patch) | |
| tree | 7aee8f593e816351b9ae4be11f74105f6eb797a9 /docs/ref | |
| parent | fd427f1fe3c563d5fe0badfec0a39d6cd43454da (diff) | |
Fixed #22684 -- Added `empty_label` option on `django.forms.extras.widets.SelectDateWidget`
Thanks danielsamuels for the report
Diffstat (limited to 'docs/ref')
| -rw-r--r-- | docs/ref/forms/widgets.txt | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/docs/ref/forms/widgets.txt b/docs/ref/forms/widgets.txt index 5569e38b47..cf309f0298 100644 --- a/docs/ref/forms/widgets.txt +++ b/docs/ref/forms/widgets.txt @@ -781,3 +781,15 @@ Composite widgets 5:_('may'), 6:_('jun'), 7:_('jul'), 8:_('aug'), 9:_('sep'), 10:_('oct'), 11:_('nov'), 12:_('dec') } + + .. attribute:: SelectDateWidget.empty_label + + .. versionadded:: 1.8 + + If the :class:`~django.forms.DateField` is not required, + :class:`SelectDateWidget` will have an empty choice at the top of + the list. You can change the text of this label + (which is ``---`` by default) with the ``empty_label`` attribute:: + + # A custom empty label + field1 = forms.DateField(widget=SelectDateWidget(empty_label="Nothing")) |
