From 728b6fd9ca8624271f072d5f4618dc3fd38e87f1 Mon Sep 17 00:00:00 2001 From: Loic Bistuer Date: Mon, 26 Jan 2015 10:28:57 +0700 Subject: Fixed #24219 -- Moved SelectDateWidget together with the other widgets and deprecated django.forms.extras. Thanks Berker Peksag and Tim Graham for the reviews. --- docs/internals/deprecation.txt | 2 ++ docs/ref/forms/widgets.txt | 15 +++++++++------ docs/releases/1.7.txt | 4 ++-- docs/releases/1.8.txt | 7 ++++--- docs/releases/1.9.txt | 4 ++++ 5 files changed, 21 insertions(+), 11 deletions(-) (limited to 'docs') diff --git a/docs/internals/deprecation.txt b/docs/internals/deprecation.txt index 250ef1f6d3..50782b363c 100644 --- a/docs/internals/deprecation.txt +++ b/docs/internals/deprecation.txt @@ -18,6 +18,8 @@ details on these changes. * The ``weak`` argument to ``django.dispatch.signals.Signal.disconnect()`` will be removed. +* The ``django.forms.extras`` package will be removed. + .. _deprecation-removed-in-2.0: 2.0 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``. diff --git a/docs/releases/1.7.txt b/docs/releases/1.7.txt index 63aa7722b8..bb3ba41a91 100644 --- a/docs/releases/1.7.txt +++ b/docs/releases/1.7.txt @@ -637,7 +637,7 @@ Forms value. * :attr:`SelectDateWidget.months - ` can be used to + ` can be used to customize the wording of the months displayed in the select widget. * The ``min_num`` and ``validate_min`` parameters were added to @@ -1378,7 +1378,7 @@ Miscellaneous the current class *and* on a parent ``Form``. * The ``required`` argument of - :class:`~django.forms.extras.widgets.SelectDateWidget` has been removed. + :class:`~django.forms.SelectDateWidget` has been removed. This widget now respects the form field's ``is_required`` attribute like other widgets. diff --git a/docs/releases/1.8.txt b/docs/releases/1.8.txt index c89c65de5c..71a2a430e3 100644 --- a/docs/releases/1.8.txt +++ b/docs/releases/1.8.txt @@ -336,9 +336,10 @@ Forms a form's :attr:`~django.forms.Form.label_suffix` while using shortcuts such as ``{{ form.as_p }}`` in templates. -* :class:`~django.forms.extras.widgets.SelectDateWidget` now accepts an - :attr:`~django.forms.extras.widgets.SelectDateWidget.empty_label` argument, which will - override the top list choice label when :class:`~django.forms.DateField` is not required. +* :class:`~django.forms.SelectDateWidget` now accepts an + :attr:`~django.forms.SelectDateWidget.empty_label` argument, which will + override the top list choice label when :class:`~django.forms.DateField` + is not required. * After an :class:`~django.forms.ImageField` has been cleaned and validated, the ``UploadedFile`` object will have an additional ``image`` attribute containing diff --git a/docs/releases/1.9.txt b/docs/releases/1.9.txt index 9abb05d921..5f62f081e9 100644 --- a/docs/releases/1.9.txt +++ b/docs/releases/1.9.txt @@ -187,6 +187,10 @@ Miscellaneous will be removed in Django 2.1. The more general ``check_expression_support()`` should be used instead. +``django.forms.extras`` is deprecated. You can find + :class:`~django.forms.SelectDateWidget` in ``django.forms.widgets`` + (or simply ``django.forms``) instead. + .. removed-features-1.9: Features removed in 1.9 -- cgit v1.3