summaryrefslogtreecommitdiff
path: root/tests/inline_formsets/models.py
diff options
context:
space:
mode:
authorClifford Gama <cliffygamy@gmail.com>2025-03-08 15:46:58 +0200
committerSarah Boyce <42296566+sarahboyce@users.noreply.github.com>2025-03-12 09:16:15 +0100
commit0ebea6e5c07485a36862e9b6e2be18d1694ad2c5 (patch)
tree6ece342336bea4fbdd74cd29a51d9a071901fc82 /tests/inline_formsets/models.py
parent5183f7c287a9a5d61ca1103b55166cda52d9c647 (diff)
Fixed #35676 -- Made BaseModelForm validate constraints that reference an InlineForeignKeyField.
Co-authored-by: Simon Charette <charette.s@gmail.com>
Diffstat (limited to 'tests/inline_formsets/models.py')
-rw-r--r--tests/inline_formsets/models.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/inline_formsets/models.py b/tests/inline_formsets/models.py
index f4c06e8fac..a090387c42 100644
--- a/tests/inline_formsets/models.py
+++ b/tests/inline_formsets/models.py
@@ -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)