📅  最后修改于: 2022-03-11 14:46:05.537000             🧑  作者: Mango
class MyModel(models.Model):
field1 = models.CharField(max_length=50)
field2 = models.CharField(max_length=50)
class Meta:
unique_together = ('field1', 'field2',)