This commit is contained in:
11
mealAPI/model/ingredient.py
Normal file
11
mealAPI/model/ingredient.py
Normal file
@@ -0,0 +1,11 @@
|
||||
#!/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')
|
||||
Reference in New Issue
Block a user