-
def __create_dish_from_dict(self, d):
""" Create Dish from dictionary """
dish = Dish(
category=self,
name=d['name'],
ingredients=d['ingredients'],
weight=d['weight'],
unit=d['unit'],
price=d['price'],
discount_price=d['discount_price']
)
return dish.save()
А, Блять, это же Python:
def __create_dish_from_dict(self, d):
""" Create Dish from dictionary """
dish = Dish(category=self, **d)
return dish.save()