-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodels.py
More file actions
25 lines (22 loc) · 800 Bytes
/
Copy pathmodels.py
File metadata and controls
25 lines (22 loc) · 800 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
from sqlalchemy import Column, Integer, String, Text, ForeignKey
from database import Base
class Ingredient(Base):
__tablename__ = "ingredients"
id = Column(Integer, primary_key=True, index=True)
name = Column(String, index=True)
quantity = Column(Integer)
unit = Column(String)
class Recipe(Base):
__tablename__ = "recipes"
id = Column(Integer, primary_key=True, index=True)
name = Column(String, index=True)
description = Column(Text)
taste_profile = Column(String)
cuisine = Column(String)
ingredients = Column(Text)
instructions = Column(Text)
class Favorite(Base):
__tablename__ = "favorites"
id = Column(Integer, primary_key=True, index=True)
recipe_id = Column(Integer, ForeignKey("recipes.id"))
user_notes = Column(Text)