This commit is contained in:
OzzieIsaacs 2017-11-13 21:33:36 +01:00
parent 01d0083fe6
commit f045c16c4e

View File

@ -925,7 +925,7 @@ def get_tags_json():
if request.method == "GET": if request.method == "GET":
query = request.args.get('q') query = request.args.get('q')
# entries = db.session.execute("select name from tags where name like '%" + query + "%'") # entries = db.session.execute("select name from tags where name like '%" + query + "%'")
entries = db.session.query(db.Tags).filter(db.Tags.iname.ilike("%" + query + "%")).all() entries = db.session.query(db.Tags).filter(db.Tags.name.ilike("%" + query + "%")).all()
# for x in entries: # for x in entries:
# alfa = dict(name=x.name) # alfa = dict(name=x.name)
json_dumps = json.dumps([dict(name=r.name) for r in entries]) json_dumps = json.dumps([dict(name=r.name) for r in entries])