1class Garden(models.Model):
2 garden_id = models.IntegerField(primary_key=True)
1#Try similar below code:
2
3class MyTable(models.Model):
4 class Meta:
5 unique_together = (('key1', 'key2'),)
6
7 key1 = models.IntegerField(primary_key=True)
8 key2 = models.IntegerField()
9#or if you want only unique mixed fields:
10
11class MyTable(models.Model):
12 class Meta:
13 unique_together = (('key1', 'key2'),)
14
15 key1 = models.IntegerField()
16 key2 = models.IntegerField()