📜  使两个表的值唯一 django - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:05.537000             🧑  作者: Mango

代码示例1
class MyModel(models.Model):
  field1 = models.CharField(max_length=50)
  field2 = models.CharField(max_length=50)

  class Meta:
    unique_together = ('field1', 'field2',)