This commit is contained in:
S. Andrew Sheppard 2015-05-28 08:29:15 -05:00
parent 0b8b288be5
commit 4a3c844b7f

View File

@ -319,6 +319,7 @@ class RelationalModel(models.Model):
class UniqueTogetherModel(models.Model): class UniqueTogetherModel(models.Model):
foreign_key = models.ForeignKey(ForeignKeyTargetModel, related_name='unique_foreign_key') foreign_key = models.ForeignKey(ForeignKeyTargetModel, related_name='unique_foreign_key')
one_to_one = models.OneToOneField(OneToOneTargetModel, related_name='unique_one_to_one') one_to_one = models.OneToOneField(OneToOneTargetModel, related_name='unique_one_to_one')
class Meta: class Meta:
unique_together = ("foreign_key", "one_to_one") unique_together = ("foreign_key", "one_to_one")