summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorSimon Charette <charette.s@gmail.com>2018-08-05 22:15:10 -0400
committerTim Graham <timograham@gmail.com>2018-10-02 10:53:04 -0400
commit9142bebff2657f2129a2028137f81d09db989968 (patch)
tree4d0ab0f5366d95f1d21e00ffdfe3fdfcf4eca787 /docs
parent0bf7b25f8f667d3710de91e91ae812efde05187c (diff)
Refs #11964 -- Changed CheckConstraint() signature to use keyword-only arguments.
Also renamed the `constraint` argument to `check` to better represent which part of the constraint the provided `Q` object represents.
Diffstat (limited to 'docs')
-rw-r--r--docs/ref/models/check-constraints.txt14
-rw-r--r--docs/ref/models/options.txt2
2 files changed, 8 insertions, 8 deletions
diff --git a/docs/ref/models/check-constraints.txt b/docs/ref/models/check-constraints.txt
index 29681d7ebc..06ddd26b54 100644
--- a/docs/ref/models/check-constraints.txt
+++ b/docs/ref/models/check-constraints.txt
@@ -23,20 +23,20 @@ explains the API references of :class:`CheckConstraint`.
``CheckConstraint`` options
===========================
-.. class:: CheckConstraint(constraint, name)
+.. class:: CheckConstraint(*, check, name)
Creates a check constraint in the database.
-``constraint``
---------------
+``check``
+---------
-.. attribute:: CheckConstraint.constraint
+.. attribute:: CheckConstraint.check
-A :class:`Q` object that specifies the condition you want the constraint to
+A :class:`Q` object that specifies the check you want the constraint to
enforce.
-For example ``CheckConstraint(Q(age__gte=18), 'age_gte_18')`` ensures the age
-field is never less than 18.
+For example ``CheckConstraint(check=Q(age__gte=18), name='age_gte_18')``
+ensures the age field is never less than 18.
``name``
--------
diff --git a/docs/ref/models/options.txt b/docs/ref/models/options.txt
index 3994e408a5..6c098a8f56 100644
--- a/docs/ref/models/options.txt
+++ b/docs/ref/models/options.txt
@@ -469,7 +469,7 @@ Django quotes column and table names behind the scenes.
class Meta:
constraints = [
- models.CheckConstraint(models.Q(age__gte=18), 'age_gte_18'),
+ models.CheckConstraint(check=models.Q(age__gte=18), name='age_gte_18'),
]
``verbose_name``