I would make Restaurant.dishes a @property that returns all dishes the
restaurant's chefs can make:
return Dish.objects.filter(chef__restaurant=self)
On May 23, 2016 14:46, "Jani Tiainen" wrote:
> Something like
>
> Chef:
> # Nothing special here, reverse relations will be done automatical
Something like
Chef:
# Nothing special here, reverse relations will be done automatically
Dish:
chef = ForeignKey(Chef)
Restaurant:
chefs = ManyToMany(Chef)
dishes = ManyToMany(Dish)
Of course, you need to build something to make sure that restaurant
doesn't serve dishes that
2 matches
Mail list logo