Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class RestaurantReview(models.Model):
- reviewer_name = models.CharField(max_length=100)
- restaurant = models.ForeignKey("Restaurant", on_delete=models.CASCADE)
- review_content = models.TextField()
- rating = models.PositiveIntegerField(validators=[validators.MaxValueValidator(5)])
- class Meta:
- ordering = ["-rating"]
- verbose_name = "Restaurant Review"
- verbose_name_plural = "Restaurant Reviews"
- unique_together = ["reviewer_name", "restaurant"]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement