mirror of
https://github.com/django/django.git
synced 2025-10-24 14:16:09 +00:00
Fixed #35676 -- Made BaseModelForm validate constraints that reference an InlineForeignKeyField.
Co-authored-by: Simon Charette <charette.s@gmail.com>
This commit is contained in:
committed by
Sarah Boyce
parent
5183f7c287
commit
0ebea6e5c0
@@ -15,6 +15,11 @@ class Child(models.Model):
|
||||
school = models.ForeignKey(School, models.CASCADE)
|
||||
name = models.CharField(max_length=100)
|
||||
|
||||
class Meta:
|
||||
constraints = [
|
||||
models.UniqueConstraint("mother", "father", name="unique_parents"),
|
||||
]
|
||||
|
||||
|
||||
class Poet(models.Model):
|
||||
name = models.CharField(max_length=100)
|
||||
|
||||
Reference in New Issue
Block a user