mirror of
https://github.com/django/django.git
synced 2025-11-01 20:31:40 +00:00
Fixed UniqueConstraint example in ref/models/constraints.txt.
This commit is contained in:
parent
0a01ca80d7
commit
f8f0f92ed9
1 changed files with 4 additions and 1 deletions
|
|
@ -78,7 +78,10 @@ The name of the constraint.
|
||||||
A :class:`Q` object that specifies the condition you want the constraint to
|
A :class:`Q` object that specifies the condition you want the constraint to
|
||||||
enforce.
|
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.
|
ensures that each user only has one draft.
|
||||||
|
|
||||||
These conditions have the same database restrictions as
|
These conditions have the same database restrictions as
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue