This commit is contained in:
parent
62e03c7ce3
commit
8a482b83e9
@ -9,7 +9,7 @@ class Meal(db.Model):
|
||||
description = db.Column(db.Text, nullable=False)
|
||||
kcal = db.Column(db.Integer, nullable=True)
|
||||
price = db.Column(db.Integer, nullable=True)
|
||||
spicy = db.Column(db.Boolean, nullable=False, default=False)
|
||||
vegan = db.Column(db.Boolean, nullable=False, default=False)
|
||||
glutenfree = db.Column(db.Boolean, nullable=False, default=False)
|
||||
spicy = db.Column(db.Boolean, nullable=True, default=False)
|
||||
vegan = db.Column(db.Boolean, nullable=True, default=False)
|
||||
glutenfree = db.Column(db.Boolean, nullable=True, default=False)
|
||||
ingredients = db.relationship('Ingredient', backref='Meal', lazy='dynamic')
|
||||
|
@ -20,8 +20,8 @@ class MealBaseResource(Resource):
|
||||
db.session.add(mealobj.data)
|
||||
db.session.commit()
|
||||
return '', 204
|
||||
except ValidationError:
|
||||
abort(406, "meal validation error")
|
||||
except ValidationError as error:
|
||||
abort(406, error.messages)
|
||||
|
||||
def get(self):
|
||||
meals = Meal.query.all()
|
||||
|
Loading…
Reference in New Issue
Block a user