34👍
✅
Use unique_together
to make sure that each user/product combination is unique:
class Review(models.Model):
class Meta:
unique_together = ['user', 'product']
user = models.ForeignKey(User)
product = models.ForeignKey(Product)
Source:stackexchange.com