summaryrefslogtreecommitdiff
path: root/docs/ref
diff options
context:
space:
mode:
authorNg Zhi An <ngzhian@gmail.com>2015-01-18 02:20:42 +0000
committerTim Graham <timograham@gmail.com>2015-01-23 15:07:03 -0500
commit56015c01c4725aeeb225a62f2702a4bbb3a3ce54 (patch)
treeef2a0abb1649338339613dff8a55009717bc6b80 /docs/ref
parent2ed1980e0f82c9a952bdecbeb6f5d36513d74cc8 (diff)
[1.8.x] Fixed #24170 -- Implemented decompress for BaseRangeField widgets
Backport of 4669b6a807811d6763b9fdc5df974cb67aa1fb56 from master
Diffstat (limited to 'docs/ref')
-rw-r--r--docs/ref/contrib/postgres/forms.txt26
1 files changed, 25 insertions, 1 deletions
diff --git a/docs/ref/contrib/postgres/forms.txt b/docs/ref/contrib/postgres/forms.txt
index f6226c4b55..d1a15907ae 100644
--- a/docs/ref/contrib/postgres/forms.txt
+++ b/docs/ref/contrib/postgres/forms.txt
@@ -161,7 +161,8 @@ Range Fields
This group of fields all share similar functionality for accepting range data.
They are based on :class:`~django.forms.MultiValueField`. They treat one
omitted value as an unbounded range. They also validate that the lower bound is
-not greater than the upper bound.
+not greater than the upper bound. All of these fields use
+:class:`~django.contrib.postgres.forms.RangeWidget`.
IntegerRangeField
~~~~~~~~~~~~~~~~~
@@ -199,3 +200,26 @@ DateRangeField
Based on :class:`~django.forms.DateField` and translates its input into
:class:`~psycopg2:psycopg2.extras.DateRange`. Default for
:class:`~django.contrib.postgres.fields.DateRangeField`.
+
+Widgets
+-------
+
+RangeWidget
+~~~~~~~~~~~
+
+.. class:: RangeWidget(base_widget, attrs=None)
+
+ Widget used by all of the range fields.
+ Based on :class:`~django.forms.MultiWidget`.
+
+ :class:`~RangeWidget` has one required argument:
+
+ .. attribute:: base_widget
+
+ A :class:`~RangeWidget` comprises a 2-tuple of ``base_widget``.
+
+ .. method:: decompress(value)
+
+ Takes a single "compressed" value of a field, for example a
+ :class:`~django.contrib.postgres.fields.DateRangeField`,
+ and returns a tuple representing and lower and upper bound.