endpoint for getting a map for a given location ID /parts/getlocationURL/<id>

pull/3/head
Marek Baczynski 6 years ago
parent dadab62e9e
commit 2b481df94c

@ -57,6 +57,16 @@ def get_locations():
r.close()
return json.dumps(l)
@app.route('/parts/getlocationURL/<locationID>')
def get_locationURL(locationID):
s = 'select map from locations where id = :id;'
r = db_engine.execute(text(s), id=locationID)
l=[];
for row in r:
l.append(row);
r.close()
return l[0][0]
@app.route('/parts/getpartinfo/<partID>')
def get_part_info(partID):
s = 'select * from parts as p inner join locations as l on p.location_id=l.id where p.id = :id;'

Loading…
Cancel
Save