diff --git a/parts/server.py b/parts/server.py index 524bccd..f62fcc0 100644 --- a/parts/server.py +++ b/parts/server.py @@ -55,6 +55,16 @@ def index(): r.close() return render_template('partsearch.html', locations=locations) +@app.route('/parts/getlocationsInContainer/') +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/') def get_locationURL(locationID): s = 'select map from locations where id = :id;'