模型.py
class Restaurant(models.Model):
#fields here
class Food(models.Model):
rating = RatingField(range=5, weight=5,can_change_vote = True,allow_delete = True,allow_anonymous = True)
restaurant = models.OneToOneField(Restaurant)
class Service(models.Model):
rating = RatingField(range=5, weight=5,can_change_vote = True,allow_delete = True,allow_anonymous = True)
restaurant = models.OneToOneField(Restaurant)
怀疑
我想如何将食物和服务与餐厅模式结合起来,并且也能够对它们进行评分,请帮助,在此先感谢