mirror of
https://github.com/django/django.git
synced 2025-10-23 21:59:11 +00:00
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.
This commit is contained in:
committed by
Tim Graham
parent
0bf7b25f8f
commit
9142bebff2
@@ -9,7 +9,7 @@ class Product(models.Model):
|
||||
class Meta:
|
||||
constraints = [
|
||||
models.CheckConstraint(
|
||||
models.Q(price__gt=models.F('discounted_price')),
|
||||
'price_gt_discounted_price'
|
||||
)
|
||||
check=models.Q(price__gt=models.F('discounted_price')),
|
||||
name='price_gt_discounted_price',
|
||||
),
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user