mirror of
https://github.com/django/django.git
synced 2025-10-23 21:59:11 +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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user