Skip to content

Commit

Permalink
[Fixes🛠️] Quantity in ingredients not needed
Browse files Browse the repository at this point in the history
  • Loading branch information
[esekyi] committed Aug 27, 2024
1 parent ab64e9f commit 4c9297f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 0 additions & 1 deletion app/models/ingredient.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion app/models/recipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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'<Recipe {self.title}>'

0 comments on commit 4c9297f

Please sign in to comment.