Update app.py
Browse files
app.py
CHANGED
@@ -32,8 +32,16 @@ class Drink(db.Model):
|
|
32 |
|
33 |
@app.route('/')
|
34 |
def index():
|
35 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
36 |
|
|
|
|
|
37 |
|
38 |
@app.route('/drinks')
|
39 |
def getdrinks():
|
|
|
32 |
|
33 |
@app.route('/')
|
34 |
def index():
|
35 |
+
drinks = Drink.query.all()
|
36 |
+
print(drinks)
|
37 |
+
output = []
|
38 |
+
for drink in drinks:
|
39 |
+
drink_data = {'name':drink.name, 'description':drink.description}
|
40 |
+
|
41 |
+
output.append(drink_data)
|
42 |
|
43 |
+
return {'drinks': output }
|
44 |
+
|
45 |
|
46 |
@app.route('/drinks')
|
47 |
def getdrinks():
|