Fixed get part info
This commit is contained in:
@@ -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):
|
||||||
|
|||||||
Reference in New Issue
Block a user