python django models unique rows

Solutions on MaxInterview for python django models unique rows by the best coders in the world

showing results for - "python django models unique rows"
Iker
06 Jun 2017
1class Getdata(models.Model):
2    title = models.CharField(max_length=255)
3    state = models.CharField(max_length=2, choices=STATE, default="0")
4    name = models.ForeignKey(School)
5    created_by = models.ForeignKey(profile)
6    class Meta:
7        unique_together = ["title", "state", "name"]
8