1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

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.
This commit is contained in:
Simon Charette
2016-03-24 20:04:25 -04:00
parent 2c125bded1
commit 1a403aa705
3 changed files with 26 additions and 3 deletions

View File

@@ -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