summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorMariusz Felisiak <felisiak.mariusz@gmail.com>2024-05-12 20:10:55 +0200
committerSarah Boyce <42296566+sarahboyce@users.noreply.github.com>2024-05-14 10:34:30 +0200
commitf030236a86a64a4befd3cc8093e2bbeceef52a31 (patch)
tree170718dd1a0685ee154ea7f6e3a52cae998a6062 /docs
parentceaf1e2848583ba832cc74715da38c802b6b0671 (diff)
Fixed #35275 -- Fixed Meta.constraints validation crash on UniqueConstraint with OpClass().
This also introduces Expression.constraint_validation_compatible that allows specifying that expression should be ignored during a constraint validation.
Diffstat (limited to 'docs')
-rw-r--r--docs/ref/models/expressions.txt9
-rw-r--r--docs/releases/5.1.txt4
2 files changed, 13 insertions, 0 deletions
diff --git a/docs/ref/models/expressions.txt b/docs/ref/models/expressions.txt
index 67baef7dfc..f630142294 100644
--- a/docs/ref/models/expressions.txt
+++ b/docs/ref/models/expressions.txt
@@ -1058,6 +1058,15 @@ calling the appropriate methods on the wrapped expression.
Tells Django that this expression can be used in
:attr:`Field.db_default`. Defaults to ``False``.
+ .. attribute:: constraint_validation_compatible
+
+ .. versionadded:: 5.1
+
+ Tells Django that this expression can be used during a constraint
+ validation. Expressions with ``constraint_validation_compatible`` set
+ to ``False`` must have only one source expression. Defaults to
+ ``True``.
+
.. attribute:: contains_aggregate
Tells Django that this expression contains an aggregate and that a
diff --git a/docs/releases/5.1.txt b/docs/releases/5.1.txt
index f2a6bccb0c..f068f3e96b 100644
--- a/docs/releases/5.1.txt
+++ b/docs/releases/5.1.txt
@@ -281,6 +281,10 @@ Models
reload a model's value. This can be used to lock the row before reloading or
to select related objects.
+* The new :attr:`.Expression.constraint_validation_compatible` attribute allows
+ specifying that the expression should be ignored during a constraint
+ validation.
+
Requests and Responses
~~~~~~~~~~~~~~~~~~~~~~