feat: Added create a recipe command

This commit is contained in:
Aerex
2019-05-05 16:06:33 -05:00
parent 48896dda23
commit a1c593b118
5 changed files with 42 additions and 12 deletions

View File

@@ -101,6 +101,15 @@ class Recipe(Schema):
except Exception as e:
raise e
def create(self):
created_recipe = {
'description': self.description,
'name': self.name,
'base_servings': self.base_servings,
'desired_servings': self.desired_servings,
'not_check_shoppinglist': self.not_check_shoppinglist
}
self.rest_service.post('recipes', created_recipe)
def get(self, include_products=False):
try:
recipe = self.rest_service.get('recipes', id=self.id)