From 7c1fd24cb0fc07ffb19db67ff2f8fa8a0322c4b2 Mon Sep 17 00:00:00 2001 From: Marek Baczynski Date: Sun, 11 Nov 2018 18:46:17 +0100 Subject: [PATCH] location containers part 1. Mostly broken. --- parts/server.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/parts/server.py b/parts/server.py index e85688a..e5fa3ec 100644 --- a/parts/server.py +++ b/parts/server.py @@ -47,7 +47,7 @@ def serveImage(img): @app.route('/parts') def index(): - query = "select id, name from locations order by left(map, strpos(map, '.')-1), UPPER(name);" + query = "select id, name from locations order by UPPER(name);" r = db_engine.execute(text(query)) locations = [] for row in r: @@ -120,7 +120,7 @@ def query(filter_dummy, query): for i in range(len(keywords)): kw_dict["kw" + str(i)] = keywords[i] - s = 'select p.id,partno,description,l.name as location_descriptor from parts as p inner join locations as l on p.location_id = l.id where ' + s = 'select p.id,partno,description, c.name || l.name as location_descriptor from parts as p inner join locations as l on p.location_id = l.id inner join containers as c on l.container_id = c.id where ' if filter['l']: s += '(' for i in range(len(keywords)):