summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
Diffstat (limited to 'docs')
-rw-r--r--docs/ref/models/constraints.txt8
-rw-r--r--docs/releases/3.1.txt2
2 files changed, 8 insertions, 2 deletions
diff --git a/docs/ref/models/constraints.txt b/docs/ref/models/constraints.txt
index 0ac54cf265..9e3119f600 100644
--- a/docs/ref/models/constraints.txt
+++ b/docs/ref/models/constraints.txt
@@ -52,12 +52,16 @@ option.
.. attribute:: CheckConstraint.check
-A :class:`Q` object that specifies the check you want the constraint to
-enforce.
+A :class:`Q` object or boolean :class:`~django.db.models.Expression` that
+specifies the check you want the constraint to enforce.
For example, ``CheckConstraint(check=Q(age__gte=18), name='age_gte_18')``
ensures the age field is never less than 18.
+.. versionchanged:: 3.1
+
+ Support for boolean :class:`~django.db.models.Expression` was added.
+
``name``
--------
diff --git a/docs/releases/3.1.txt b/docs/releases/3.1.txt
index 16f9ed01be..bff16dc1ab 100644
--- a/docs/releases/3.1.txt
+++ b/docs/releases/3.1.txt
@@ -204,6 +204,8 @@ Models
``OneToOneField`` emulates the behavior of the SQL constraint ``ON DELETE
RESTRICT``.
+* :attr:`.CheckConstraint.check` now supports boolean expressions.
+
Pagination
~~~~~~~~~~