SanjeevB1 commited on
Commit
6c9b453
·
verified ·
1 Parent(s): c3f7f47

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -1
app.py CHANGED
@@ -32,8 +32,16 @@ class Drink(db.Model):
32
 
33
  @app.route('/')
34
  def index():
35
- return 'hello welcome to sanjeev page please use /drinks for all drinks /drinks/<id> for specific /drinks[POST] with name and description to update the list'
 
 
 
 
 
 
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():