From 4c9297f90572562c5c8d80ac256dd9e4b617941b Mon Sep 17 00:00:00 2001 From: "[esekyi]" <[sskert10@gmail.com]> Date: Tue, 27 Aug 2024 03:46:19 +0000 Subject: [PATCH] =?UTF-8?q?[Fixes=F0=9F=9B=A0=EF=B8=8F]=20Quantity=20in=20?= =?UTF-8?q?ingredients=20not=20needed?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/ingredient.py | 1 - app/models/recipe.py | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/ingredient.py b/app/models/ingredient.py index 0c09b9f..2743edf 100644 --- a/app/models/ingredient.py +++ b/app/models/ingredient.py @@ -8,7 +8,6 @@ class Ingredient(db.Model): id = db.Column(UUID(as_uuid=True), primary_key=True, default=uuid.uuid4) name = db.Column(db.String(120), nullable=False) - quantity = db.Column(db.String(50), nullable=False) recipe_id = db.Column(UUID(as_uuid=True), db.ForeignKey( 'recipe.id'), nullable=False) created_at = db.Column(db.DateTime, default=datetime.utcnow) diff --git a/app/models/recipe.py b/app/models/recipe.py index 1eb8de9..1d26791 100644 --- a/app/models/recipe.py +++ b/app/models/recipe.py @@ -9,7 +9,6 @@ class Recipe(db.Model): default=uuid.uuid4) title = db.Column(db.String(120), nullable=False) description = db.Column(db.Text, nullable=False) - instructions = db.Column(db.Text, nullable=False) prep_time = db.Column(db.Integer) # in minutes cook_time = db.Column(db.Integer) # in minutes servings = db.Column(db.Integer) @@ -25,6 +24,8 @@ class Recipe(db.Model): comments = db.relationship('Comment', backref='recipe', lazy=True) ingredients = db.relationship( 'Ingredient', backref='recipe', lazy='dynamic') + instructions = db.relationship( + 'Instruction', backref='recipes', lazy='dynamic') def __repr__(self): return f''