summaryrefslogtreecommitdiff
path: root/tests/inline_formsets/models.py
diff options
context:
space:
mode:
authorSimon Charette <charette.s@gmail.com>2016-03-24 20:04:25 -0400
committerSimon Charette <charette.s@gmail.com>2016-03-26 21:49:41 -0400
commit1a403aa705e7921eb6ec88c7d9f686ab0e54ef76 (patch)
tree0a4d0cdab524eed7386001bf82da1a325b311417 /tests/inline_formsets/models.py
parent2c125bded1834cadf3a6132d9ab87bc74f5ed728 (diff)
Fixed #25987 -- Made inline formset validation respect unique_together with an unsaved parent object.
Thanks Anton Kuzmichev for the report and Tim for the review.
Diffstat (limited to 'tests/inline_formsets/models.py')
-rw-r--r--tests/inline_formsets/models.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/inline_formsets/models.py b/tests/inline_formsets/models.py
index d94069d5db..70f9008d8b 100644
--- a/tests/inline_formsets/models.py
+++ b/tests/inline_formsets/models.py
@@ -31,5 +31,8 @@ class Poem(models.Model):
poet = models.ForeignKey(Poet, models.CASCADE)
name = models.CharField(max_length=100)
+ class Meta:
+ unique_together = ('poet', 'name')
+
def __str__(self):
return self.name