mirror of
https://github.com/django/django.git
synced 2025-10-23 21:59:11 +00:00
Fixed #33342 -- Added support for using OpClass() in exclusion constraints.
This commit is contained in:
committed by
Mariusz Felisiak
parent
a0d43a7a6e
commit
0e656c02fe
@@ -53,6 +53,10 @@ operators with strings. For example::
|
||||
|
||||
Only commutative operators can be used in exclusion constraints.
|
||||
|
||||
.. versionchanged:: 4.1
|
||||
|
||||
Support for the ``OpClass()`` expression was added.
|
||||
|
||||
``index_type``
|
||||
--------------
|
||||
|
||||
@@ -143,6 +147,20 @@ For example::
|
||||
|
||||
creates an exclusion constraint on ``circle`` using ``circle_ops``.
|
||||
|
||||
Alternatively, you can use
|
||||
:class:`OpClass() <django.contrib.postgres.indexes.OpClass>` in
|
||||
:attr:`~ExclusionConstraint.expressions`::
|
||||
|
||||
ExclusionConstraint(
|
||||
name='exclude_overlapping_opclasses',
|
||||
expressions=[(OpClass('circle', 'circle_ops'), RangeOperators.OVERLAPS)],
|
||||
)
|
||||
|
||||
.. versionchanged:: 4.1
|
||||
|
||||
Support for specifying operator classes with the ``OpClass()`` expression
|
||||
was added.
|
||||
|
||||
Examples
|
||||
--------
|
||||
|
||||
|
||||
Reference in New Issue
Block a user