Fixed get part info

pull/3/head
assar 8 years ago
parent e4bb2d6616
commit ad1a81042a

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

Loading…
Cancel
Save