0

models.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)

疑問に思う

食事 と サービス を レストラン モデル と 統合 し , それら を 評価 できる よう に する 方法 を 教え て ください .

4

1 に答える 1

1

それ以外の:

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)

試す:

class Restaurant(models.Model):
    #fields here
    food_rating = RatingField(range=5, weight=5,can_change_vote = True,allow_delete = True,allow_anonymous = True)
    service_rating = RatingField(range=5, weight=5,can_change_vote = True,allow_delete = True,allow_anonymous = True)

接吻

于 2012-08-24T16:09:18.350 に答える