one to many
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2022-02-13 21:04:24 +01:00
parent 26428e8cb8
commit 794721a0cb
3 changed files with 1 additions and 14 deletions

View File

@@ -1,11 +1,8 @@
#!/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.__tablename__, back_populates='Ingredient')