summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
Diffstat (limited to 'docs')
-rw-r--r--docs/ref/models/constraints.txt5
1 files changed, 4 insertions, 1 deletions
diff --git a/docs/ref/models/constraints.txt b/docs/ref/models/constraints.txt
index acf3375b4a..698b89ff54 100644
--- a/docs/ref/models/constraints.txt
+++ b/docs/ref/models/constraints.txt
@@ -78,7 +78,10 @@ The name of the constraint.
A :class:`Q` object that specifies the condition you want the constraint to
enforce.
-For example, ``UniqueConstraint(fields=['user'], condition=Q(status='DRAFT')``
+For example::
+
+ UniqueConstraint(fields=['user'], condition=Q(status='DRAFT'), name='unique_draft_user')
+
ensures that each user only has one draft.
These conditions have the same database restrictions as