Added mealplanner and searchuser endpoint

master
Davide Bongiovanni 6 years ago
parent 5f7b38b839
commit 181214c5c6

@ -141,6 +141,21 @@ def view_meal():
print(meal) print(meal)
return render_template('view_meal.html', leaderboard=getLeaderboard(), meal=meal) return render_template('view_meal.html', leaderboard=getLeaderboard(), meal=meal)
@app.route('/mealplanner')
def meal_planner():
return render_template('meal_planner.html')
@app.route('/searchusers')
def search_users():
q = request.args.get('q')
query = 'select username from users where id>0 and username like :q;'
r = db_engine.execute(text(query), q=(q+'%'))
result = []
for row in r:
result.append(list(row)[0])
r.close()
return str(result)
@app.route('/login', methods=['GET', 'POST']) @app.route('/login', methods=['GET', 'POST'])
def login(): def login():
if request.method == 'POST': if request.method == 'POST':

Loading…
Cancel
Save