Finished Search
All checks were successful
Potlatch Loggers Organization/ComputerKeeper/pipeline/head This commit looks good
All checks were successful
Potlatch Loggers Organization/ComputerKeeper/pipeline/head This commit looks good
This commit is contained in:
parent
1940c954e9
commit
2db9b71605
12
main.py
12
main.py
@ -10,7 +10,7 @@ WINDOW=None
|
||||
# Define the window's contents
|
||||
colum_lut = ["Serial Number","Brand","Grade","Name"]
|
||||
layout = [[sg.Menu([['File', ['Open', 'Save', 'Add Computer','Remove Computer']]])],
|
||||
[sg.Text("search"), sg.Input(s=(35,))],
|
||||
[sg.Text("search"), sg.Input(s=(35,), enable_events=True,key="search")],
|
||||
[sg.Input(s=(19,),enable_events=True,key="filter Serial Number"),
|
||||
sg.Input(s=(6,),enable_events=True,key="filter Brand"),
|
||||
sg.Input(s=(6,),enable_events=True,key="filter Grade"),
|
||||
@ -110,6 +110,16 @@ def main():
|
||||
result=db.search(Computers[event[7:]].test(filter_database))
|
||||
window["table"].update(format_table(result))
|
||||
|
||||
elif event == "search":
|
||||
filter_database = lambda s: s.lower().find(values[event].lower()) != -1
|
||||
Computers=Query()
|
||||
result=db.search(
|
||||
Computers["Serial Number"].test(filter_database)|
|
||||
Computers["Brand"].test(filter_database)|
|
||||
Computers["Grade"].test(filter_database)|
|
||||
Computers["Name"].test(filter_database)
|
||||
)
|
||||
window["table"].update(format_table(result))
|
||||
|
||||
# Finish up by removing from the screen
|
||||
window.close()
|
||||
|
Loading…
Reference in New Issue
Block a user