make value of two tables unique django

Solutions on MaxInterview for make value of two tables unique django by the best coders in the world

showing results for - "make value of two tables unique django"
Nick
18 Nov 2020
1class MyModel(models.Model):
2  field1 = models.CharField(max_length=50)
3  field2 = models.CharField(max_length=50)
4
5  class Meta:
6    unique_together = ('field1', 'field2',)