Fixed get part info

master
assar 8 years ago
parent e4bb2d6616
commit ad1a81042a

@ -17,11 +17,13 @@ def index():
@app.route('/getpartinfo/<partID>')
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/<filter>/<query>')
def query(filter, query):

Loading…
Cancel
Save