|
|
|
@ -152,8 +152,12 @@ def meal_planner():
|
|
|
|
|
@app.route('/searchusers')
|
|
|
|
|
def search_users():
|
|
|
|
|
q = request.args.get('q')
|
|
|
|
|
s = request.args.get('s')
|
|
|
|
|
query = 'select username from users where id>0 and username like :q;'
|
|
|
|
|
r = db_engine.execute(text(query), q=(q+'%'))
|
|
|
|
|
if s == '1':
|
|
|
|
|
r = db_engine.execute(text(query), q=(q+'%'))
|
|
|
|
|
else:
|
|
|
|
|
r = db_engine.execute(text(query), q=q)
|
|
|
|
|
result = []
|
|
|
|
|
for row in r:
|
|
|
|
|
result.append(list(row)[0])
|
|
|
|
|