meal_homework/mealapi/model/ingredient.py
Torma Kristóf c20b5f7c98
All checks were successful
continuous-integration/drone/push Build is passing
lowecase
2022-02-13 20:39:14 +01:00

12 lines
398 B
Python

#!/usr/bin/env python3
from .db import db
from .mealingredient import MealIngredient
class Ingredient(db.Model):
__tablename__ = 'Ingredient'
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String, nullable=False, unique=True)
value = db.Column(db.String, nullable=False)
items = db.relationship('Meal', secondary=MealIngredient, back_populates='Ingredient')