mirror of
https://github.com/django/django.git
synced 2025-08-04 02:48:35 +00:00
Fixed #29824 -- Added support for database exclusion constraints on PostgreSQL.
Thanks to Nick Pope and Mariusz Felisiak for review. Co-Authored-By: Mariusz Felisiak <felisiak.mariusz@gmail.com>
This commit is contained in:
parent
7174cf0b00
commit
a3417282ac
9 changed files with 589 additions and 4 deletions
|
@ -944,3 +944,26 @@ corresponding lookups.
|
|||
NOT_LT = '&>'
|
||||
NOT_GT = '&<'
|
||||
ADJACENT_TO = '-|-'
|
||||
|
||||
RangeBoundary() expressions
|
||||
---------------------------
|
||||
|
||||
.. versionadded:: 3.0
|
||||
|
||||
.. class:: RangeBoundary(inclusive_lower=True, inclusive_upper=False)
|
||||
|
||||
.. attribute:: inclusive_lower
|
||||
|
||||
If ``True`` (default), the lower bound is inclusive ``'['``, otherwise
|
||||
it's exclusive ``'('``.
|
||||
|
||||
.. attribute:: inclusive_upper
|
||||
|
||||
If ``False`` (default), the upper bound is exclusive ``')'``, otherwise
|
||||
it's inclusive ``']'``.
|
||||
|
||||
A ``RangeBoundary()`` expression represents the range boundaries. It can be
|
||||
used with a custom range functions that expected boundaries, for example to
|
||||
define :class:`~django.contrib.postgres.constraints.ExclusionConstraint`. See
|
||||
`the PostgreSQL documentation for the full details <https://www.postgresql.org/
|
||||
docs/current/rangetypes.html#RANGETYPES-INCLUSIVITY>`_.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue