mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #24001 -- Added range fields for PostgreSQL.
Added support for PostgreSQL range types to contrib.postgres. - 5 new model fields - 4 new form fields - New validators - Uses psycopg2's range type implementation in python
This commit is contained in:
@@ -154,3 +154,48 @@ HStoreField
|
||||
On occasions it may be useful to require or restrict the keys which are
|
||||
valid for a given field. This can be done using the
|
||||
:class:`~django.contrib.postgres.validators.KeysValidator`.
|
||||
|
||||
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.
|
||||
|
||||
IntegerRangeField
|
||||
~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. class:: IntegerRangeField
|
||||
|
||||
Based on :class:`~django.forms.IntegerField` and translates its input into
|
||||
:class:`~psycopg2:psycopg2.extras.NumericRange`. Default for
|
||||
:class:`~django.contrib.postgres.fields.IntegerRangeField` and
|
||||
:class:`~django.contrib.postgres.fields.BigIntegerRangeField`.
|
||||
|
||||
FloatRangeField
|
||||
~~~~~~~~~~~~~~~
|
||||
|
||||
.. class:: FloatRangeField
|
||||
|
||||
Based on :class:`~django.forms.FloatField` and translates its input into
|
||||
:class:`~psycopg2:psycopg2.extras.NumericRange`. Default for
|
||||
:class:`~django.contrib.postgres.fields.FloatRangeField`.
|
||||
|
||||
DateTimeRangeField
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. class:: DateTimeRangeField
|
||||
|
||||
Based on :class:`~django.forms.DateTimeField` and translates its input into
|
||||
:class:`~psycopg2:psycopg2.extras.DateTimeTZRange`. Default for
|
||||
:class:`~django.contrib.postgres.fields.DateTimeRangeField`.
|
||||
|
||||
DateRangeField
|
||||
~~~~~~~~~~~~~~
|
||||
|
||||
.. class:: 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`.
|
||||
|
||||
Reference in New Issue
Block a user