summaryrefslogtreecommitdiff
path: root/docs/ref/forms
diff options
context:
space:
mode:
authorLoic Bistuer <loic.bistuer@gmail.com>2015-01-26 10:28:57 +0700
committerLoic Bistuer <loic.bistuer@gmail.com>2015-01-27 22:40:02 +0700
commit728b6fd9ca8624271f072d5f4618dc3fd38e87f1 (patch)
tree3f91c283af33d95d02d9974cb66249594769613f /docs/ref/forms
parent3a4c9e1b43ff67b6cf4c59da757666d6ac5ce4a0 (diff)
Fixed #24219 -- Moved SelectDateWidget together with the other widgets
and deprecated django.forms.extras. Thanks Berker Peksag and Tim Graham for the reviews.
Diffstat (limited to 'docs/ref/forms')
-rw-r--r--docs/ref/forms/widgets.txt15
1 files changed, 9 insertions, 6 deletions
diff --git a/docs/ref/forms/widgets.txt b/docs/ref/forms/widgets.txt
index 242a77110f..55b29c131e 100644
--- a/docs/ref/forms/widgets.txt
+++ b/docs/ref/forms/widgets.txt
@@ -49,11 +49,10 @@ Setting arguments for widgets
Many widgets have optional extra arguments; they can be set when defining the
widget on the field. In the following example, the
-:attr:`~django.forms.extras.widgets.SelectDateWidget.years` attribute is set
-for a :class:`~django.forms.extras.widgets.SelectDateWidget`::
+:attr:`~django.forms.SelectDateWidget.years` attribute is set for a
+:class:`~django.forms.SelectDateWidget`::
from django import forms
- from django.forms.extras.widgets import SelectDateWidget
BIRTH_YEAR_CHOICES = ('1980', '1981', '1982')
FAVORITE_COLORS_CHOICES = (('blue', 'Blue'),
@@ -61,7 +60,7 @@ for a :class:`~django.forms.extras.widgets.SelectDateWidget`::
('black', 'Black'))
class SimpleForm(forms.Form):
- birth_year = forms.DateField(widget=SelectDateWidget(years=BIRTH_YEAR_CHOICES))
+ birth_year = forms.DateField(widget=forms.SelectDateWidget(years=BIRTH_YEAR_CHOICES))
favorite_colors = forms.MultipleChoiceField(required=False,
widget=forms.CheckboxSelectMultiple, choices=FAVORITE_COLORS_CHOICES)
@@ -752,8 +751,6 @@ Composite widgets
Similar to :class:`SplitDateTimeWidget`, but uses :class:`HiddenInput` for
both date and time.
-.. currentmodule:: django.forms.extras.widgets
-
``SelectDateWidget``
~~~~~~~~~~~~~~~~~~~~
@@ -807,3 +804,9 @@ Composite widgets
# A custom empty label with tuple
field1 = forms.DateField(widget=SelectDateWidget(
empty_label=("Choose Year", "Choose Month", "Choose Day"))
+
+ .. versionchanged:: 1.9
+
+ This widget used to be located in the ``django.forms.extras.widgets``
+ package. It is now defined in ``django.forms.widgets`` and like the
+ other widgets it can be imported directly from ``django.forms``.