|
|
@ -47,17 +47,13 @@ def serveImage(img):
|
|
|
|
|
|
|
|
|
|
|
|
@app.route('/parts')
|
|
|
|
@app.route('/parts')
|
|
|
|
def index():
|
|
|
|
def index():
|
|
|
|
return render_template('partsearch.html')
|
|
|
|
query = "select id, name from locations order by left(map, strpos(map, '.')-1), UPPER(name);"
|
|
|
|
|
|
|
|
r = db_engine.execute(text(query))
|
|
|
|
@app.route('/parts/getlocations/')
|
|
|
|
locations = []
|
|
|
|
def get_locations():
|
|
|
|
|
|
|
|
s = 'select id, name from locations order by name;'
|
|
|
|
|
|
|
|
r = db_engine.execute(text(s))
|
|
|
|
|
|
|
|
l = {}
|
|
|
|
|
|
|
|
for row in r:
|
|
|
|
for row in r:
|
|
|
|
l[row[0]]=row[1]
|
|
|
|
locations.append(dict(row))
|
|
|
|
r.close()
|
|
|
|
r.close()
|
|
|
|
return json.dumps(l)
|
|
|
|
return render_template('partsearch.html', locations=locations)
|
|
|
|
|
|
|
|
|
|
|
|
@app.route('/parts/getlocationURL/<locationID>')
|
|
|
|
@app.route('/parts/getlocationURL/<locationID>')
|
|
|
|
def get_locationURL(locationID):
|
|
|
|
def get_locationURL(locationID):
|
|
|
|