2022-02-13 20:38:02 +01:00
|
|
|
#!/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)
|
2022-02-13 21:00:35 +01:00
|
|
|
items = db.relationship('Meal', secondary=MealIngredient.__tablename__, back_populates='Ingredient')
|