diff options
| author | Simon Charette <charette.s@gmail.com> | 2019-11-15 00:08:36 -0500 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2019-11-21 11:56:35 +0100 |
| commit | e9a0e1d4f6ecfc4227acff74e1f56f288a0b30aa (patch) | |
| tree | deecc4f80b577d47f03e8ade90f410aa4cf32e07 /docs | |
| parent | 37e6c5b79bd0529a3c85b8c478e4002fd33a2a1d (diff) | |
Fixed #30484 -- Added conditional expressions support to CheckConstraint.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/ref/models/constraints.txt | 8 | ||||
| -rw-r--r-- | docs/releases/3.1.txt | 2 |
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 ~~~~~~~~~~ |
