Modified query to be joint with locations

pull/3/head
Davide Bongiovanni 6 years ago
parent 9bf4943d3a
commit 48f8ef5ddc

@ -53,7 +53,7 @@ def get_part_info(partID):
def query(filter, query): def query(filter, query):
query = '%' + query + '%' query = '%' + query + '%'
filter = int(filter) filter = int(filter)
s = 'select * from parts where ' 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 '
if filter & (1 << 1) != 0: if filter & (1 << 1) != 0:
s += 'LOWER(partno) like LOWER(:name) or ' s += 'LOWER(partno) like LOWER(:name) or '
if filter & (1 << 4) != 0: if filter & (1 << 4) != 0:

Loading…
Cancel
Save