summaryrefslogtreecommitdiff
path: root/docs/ref
diff options
context:
space:
mode:
authorDavid Sanders <shang.xiao.sanders@gmail.com>2022-09-09 00:02:58 +1000
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2022-09-13 12:48:31 +0200
commite14d08cd894e9d91cb5d9f44ba7532c1a223f458 (patch)
treea524445fadbda60124a63468c643f31639d794fc /docs/ref
parentb731e8841558ee4caaba766c83f34ea9c7004f8b (diff)
Fixed #33996 -- Fixed CheckConstraint validation on NULL values.
Bug in 667105877e6723c6985399803a364848891513cc. Thanks James Beith for the report.
Diffstat (limited to 'docs/ref')
-rw-r--r--docs/ref/models/constraints.txt9
1 files changed, 9 insertions, 0 deletions
diff --git a/docs/ref/models/constraints.txt b/docs/ref/models/constraints.txt
index d0a9a017dc..8134a657d8 100644
--- a/docs/ref/models/constraints.txt
+++ b/docs/ref/models/constraints.txt
@@ -102,6 +102,15 @@ 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.
+.. admonition:: Oracle
+
+ Checks with nullable fields on Oracle must include a condition allowing for
+ ``NULL`` values in order for :meth:`validate() <BaseConstraint.validate>`
+ to behave the same as check constraints validation. For example, if ``age``
+ is a nullable field::
+
+ CheckConstraint(check=Q(age__gte=18) | Q(age__isnull=True), name='age_gte_18')
+
.. versionchanged:: 4.1
The ``violation_error_message`` argument was added.