endpoint for listing locations in a given container

master
Marek Baczynski 6 years ago
parent 5df74f1276
commit d31799b3aa

@ -55,6 +55,16 @@ def index():
r.close() r.close()
return render_template('partsearch.html', locations=locations) return render_template('partsearch.html', locations=locations)
@app.route('/parts/getlocationsInContainer/<containerID>')
def get_locations_in_container(containerID):
s = 'select id, name from locations where container_id = :id order by name;'
r = db_engine.execute(text(s), id=containerID)
l={}
for row in r:
l[row[0]]= row[1];
r.close()
return json.dumps(l)
@app.route('/parts/getlocationURL/<locationID>') @app.route('/parts/getlocationURL/<locationID>')
def get_locationURL(locationID): def get_locationURL(locationID):
s = 'select map from locations where id = :id;' s = 'select map from locations where id = :id;'

Loading…
Cancel
Save