summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorLoic Bistuer <loic.bistuer@sixmedia.com>2013-08-28 13:22:47 +0700
committerAnssi Kääriäinen <akaariai@gmail.com>2013-08-28 16:39:26 +0300
commitda800be6ddfdd4c88b48011ef264ea1ec6365725 (patch)
tree8fff30e7cdfe09cdaf0bc2cc3ba8b933c3e0e3a6 /docs
parentb89c2a5d9eb70ca36629ef657c98e3371e9a5c4f (diff)
Fixed #20986 -- Enabled SelectDateWidget to use custom months
Reviewed by Trac alias MarkusH.
Diffstat (limited to 'docs')
-rw-r--r--docs/ref/forms/widgets.txt17
-rw-r--r--docs/releases/1.7.txt4
2 files changed, 21 insertions, 0 deletions
diff --git a/docs/ref/forms/widgets.txt b/docs/ref/forms/widgets.txt
index 47e14043fc..efe947568e 100644
--- a/docs/ref/forms/widgets.txt
+++ b/docs/ref/forms/widgets.txt
@@ -763,3 +763,20 @@ Composite widgets
An optional list/tuple of years to use in the "year" select box.
The default is a list containing the current year and the next 9 years.
+
+ .. attribute:: SelectDateWidget.months
+
+ .. versionadded:: 1.7
+
+ An optional dict of months to use in the "months" select box.
+
+ The keys of the dict correspond to the month number (1-indexed) and
+ the values are the displayed months.
+
+ .. code-block:: python
+
+ MONTHS = {
+ 1:_('jan'), 2:_('feb'), 3:_('mar'), 4:_('apr'),
+ 5:_('may'), 6:_('jun'), 7:_('jul'), 8:_('aug'),
+ 9:_('sep'), 10:_('oct'), 11:_('nov'), 12:_('dec')
+ }
diff --git a/docs/releases/1.7.txt b/docs/releases/1.7.txt
index e057c49e78..2bf7c0258f 100644
--- a/docs/releases/1.7.txt
+++ b/docs/releases/1.7.txt
@@ -213,6 +213,10 @@ Forms
return ``self.cleaned_data``. If it does return a changed dictionary then
that will still be used.
+* :attr:`SelectDateWidget.months
+ <django.forms.extras.widgets.SelectDateWidget.months>` can be used to
+ customize the wording of the months displayed in the select widget.
+
Management Commands
^^^^^^^^^^^^^^^^^^^