forked from hanyslmm/itemcatalog
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmenu_items.py
161 lines (107 loc) · 6.2 KB
/
menu_items.py
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
# import all modules needed for configuration
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from database_setup import Base, Restaurant, MenuItem
# === let program know which database engine we want to communicate===
engine = create_engine('sqlite:///restaurantmenu.db')
# bind the engine to the Base class corresponding tables
Base.metadata.bind = engine
# create session maker object
DBSession = sessionmaker(bind=engine)
# A DBSession() instance establishes all conversations with the database
# and represents a "staging zone" for all the objects loaded into the
# database session object. Any change made against the objects in the
# session won't be persisted into the database until you call
# session.commit(). If you're not happy about the changes, you can
# revert all of them back to the last commit by calling
# session.rollback()
session = DBSession()
# Menu for Burger Father
restaurant2 = Restaurant(name="Burger Father")
session.add(restaurant2)
session.commit()
menuItem1 = MenuItem(name="French Fries", description="with garlic and parmesan",
price="$2.99", course="Appetizer", restaurant=restaurant2)
session.add(menuItem1)
session.commit()
menuItem2 = MenuItem(name="Chicken Burger", description="Juicy grilled chicken patty with tomato mayo and lettuce",
price="$5.50", course="Entree", restaurant=restaurant2)
session.add(menuItem2)
session.commit()
menuItem3 = MenuItem(name="Chocolate Cake", description="fresh baked and served with ice cream",
price="$3.99", course="Dessert", restaurant=restaurant2)
session.add(menuItem3)
session.commit()
menuItem4 = MenuItem(name="Sirloin Burger", description="Made with grade A beef",
price="$7.99", course="Entree", restaurant=restaurant2)
session.add(menuItem4)
session.commit()
menuItem5 = MenuItem(name="Root Beer", description="16oz of refreshing goodness",
price="$1.99", course="Beverage", restaurant=restaurant2)
session.add(menuItem5)
session.commit()
menuItem6 = MenuItem(name="Iced Tea", description="with Lemon",
price="$.99", course="Beverage", restaurant=restaurant2)
session.add(menuItem6)
session.commit()
menuItem7 = MenuItem(name="Grilled Cheese Sandwich", description="On texas toast with American Cheese",
price="$3.49", course="Entree", restaurant=restaurant2)
session.add(menuItem7)
session.commit()
menuItem8 = MenuItem(name="Veggie Burger", description="Made with freshest of ingredients and home grown spices",
price="$5.99", course="Entree", restaurant=restaurant2)
session.add(menuItem8)
session.commit()
# Menu for Chicken Father
restaurant3 = Restaurant(name="Chicken Father")
session.add(restaurant3)
session.commit()
menuItem1 = MenuItem(name="Chicken Stir Fry", description="With your choice of noodles vegetables and sauces",
price="$7.99", course="Entree", restaurant=restaurant3)
session.add(menuItem1)
session.commit()
menuItem2 = MenuItem(
name="Peking Duck", description=" A famous duck dish from Beijing[1] that has been prepared since the imperial era. The meat is prized for its thin, crisp skin, with authentic versions of the dish serving mostly the skin and little meat, sliced in front of the diners by the cook", price="$25", course="Entree", restaurant=restaurant3)
session.add(menuItem2)
session.commit()
menuItem3 = MenuItem(name="Spicy Tuna Roll", description="Seared rare ahi, avocado, edamame, cucumber with wasabi soy sauce ",
price="15", course="Entree", restaurant=restaurant3)
session.add(menuItem3)
session.commit()
menuItem4 = MenuItem(name="Nepali Momo ", description="Steamed dumplings made with vegetables, spices and meat. ",
price="12", course="Entree", restaurant=restaurant3)
session.add(menuItem4)
session.commit()
menuItem5 = MenuItem(name="Beef Noodle Soup", description="A Chinese noodle soup made of stewed or red braised beef, beef broth, vegetables and Chinese noodles.",
price="14", course="Entree", restaurant=restaurant3)
session.add(menuItem5)
session.commit()
menuItem6 = MenuItem(name="Ramen", description="a Japanese noodle soup dish. It consists of Chinese-style wheat noodles served in a meat- or (occasionally) fish-based broth, often flavored with soy sauce or miso, and uses toppings such as sliced pork, dried seaweed, kamaboko, and green onions.",
price="12", course="Entree", restaurant=restaurant3)
session.add(menuItem6)
session.commit()
# Menu for Panda Garden
restaurant4 = Restaurant(name="Soup Father")
session.add(restaurant4)
session.commit()
menuItem1 = MenuItem(name="Pho", description="a Vietnamese noodle soup consisting of broth, linguine-shaped rice noodles called banh pho, a few herbs, and meat.",
price="$8.99", course="Entree", restaurant=restaurant4)
session.add(menuItem1)
session.commit()
menuItem2 = MenuItem(name="Chinese Dumplings", description="a common Chinese dumpling which generally consists of minced meat and finely chopped vegetables wrapped into a piece of dough skin. The skin can be either thin and elastic or thicker.",
price="$6.99", course="Appetizer", restaurant=restaurant4)
session.add(menuItem2)
session.commit()
menuItem3 = MenuItem(name="Gyoza", description="The most prominent differences between Japanese-style gyoza and Chinese-style jiaozi are the rich garlic flavor, which is less noticeable in the Chinese version, the light seasoning of Japanese gyoza with salt and soy sauce, and the fact that gyoza wrappers are much thinner",
price="$9.95", course="Entree", restaurant=restaurant4)
session.add(menuItem3)
session.commit()
menuItem4 = MenuItem(name="Stinky Tofu", description="Taiwanese dish, deep fried fermented tofu served with pickled cabbage.",
price="$6.99", course="Entree", restaurant=restaurant4)
session.add(menuItem4)
session.commit()
menuItem5 = MenuItem(name="Veggie Burger", description="Juicy grilled veggie patty with tomato mayo and lettuce",
price="$9.50", course="Entree", restaurant=restaurant4)
session.add(menuItem5)
session.commit()
print("added menu items!")