From 65580173d06c4993a3f1e3e7c924d82686320773 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torma=20Krist=C3=B3f?= Date: Sun, 13 Feb 2022 21:31:37 +0100 Subject: [PATCH] use back_populates properly --- mealapi/model/ingredient.py | 1 + 1 file changed, 1 insertion(+) diff --git a/mealapi/model/ingredient.py b/mealapi/model/ingredient.py index 187c083..fab64a3 100644 --- a/mealapi/model/ingredient.py +++ b/mealapi/model/ingredient.py @@ -7,3 +7,4 @@ class Ingredient(db.Model): id = db.Column(db.Integer, primary_key=True) name = db.Column(db.String(255), nullable=False, unique=True) meal_id = db.Column(db.Integer, db.ForeignKey('Meal.id')) + meal = db.relationship('Meal', back_populates='Ingredient', lazy='dynamic')