meal_homework/mealapi/model/meal.py
Torma Kristóf f533ca0743
All checks were successful
continuous-integration/drone/push Build is passing
do not use loader
2022-02-13 21:34:23 +01:00

16 lines
613 B
Python

#!/usr/bin/env python3
from .db import db
class Meal(db.Model):
__tablename__ = 'Meal'
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String(255), nullable=False)
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=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', back_populates='meal')