diff --git a/mealapi/model/ingredient.py b/mealapi/model/ingredient.py index 42edc6d..75b9406 100644 --- a/mealapi/model/ingredient.py +++ b/mealapi/model/ingredient.py @@ -8,4 +8,4 @@ class Ingredient(db.Model): 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') + items = db.relationship('Meal', secondary=MealIngredient.__tablename__, back_populates='Ingredient') diff --git a/mealapi/model/meal.py b/mealapi/model/meal.py index 93d6f3d..8b09c65 100644 --- a/mealapi/model/meal.py +++ b/mealapi/model/meal.py @@ -13,4 +13,4 @@ class Meal(db.Model): spicy = db.Column(db.Boolean, nullable=False, default=False) vegan = db.Column(db.Boolean, nullable=False, default=False) glutenfree = db.Column(db.Boolean, nullable=False, default=False) - ingredients = db.relationship('Ingredient', secondary=MealIngredient, back_populates='Meal') + ingredients = db.relationship('Ingredient', secondary=MealIngredient.__tablename__, back_populates='Meal')