class Votes(models.Model):
field1 = models.ForeignKey(Blah1)
field2 = models.ForeignKey(Blah2)
class Meta:
unique_together = (("field1","field2"),)
I am using this code as one of my models. Now i wanted to know two things:
1. It doesn't show any error and it saved an entry which wasn't unique together; So is the piece of code correct?
2. How can the unique_together
constraint be be validated?