diff --git a/server.py b/server.py index 0b6819d..f52cba8 100644 --- a/server.py +++ b/server.py @@ -17,11 +17,13 @@ def index(): @app.route('/getpartinfo/') def get_part_info(partID): - s = 'select * from parts where id = :id' - r = db_engine.execute(s, id=partID) - l = dict(r) + s = 'select * from parts where id = :id;' + r = db_engine.execute(text(s), id=partID) + l = [] + for row in r: + l.append(dict(row)) r.close() - return json.dumps(l) + return json.dumps(l[0]) @app.route('/query//') def query(filter, query):