From 3f56ee7a8152dc987bf1abc8cbd26a7c59b3e95a Mon Sep 17 00:00:00 2001 From: Josh b Date: Sun, 4 Sep 2022 18:57:27 -0700 Subject: [PATCH] Fixed table and saved to database --- db.json | 1 + main.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/db.json b/db.json index e69de29..7a4d865 100644 --- a/db.json +++ b/db.json @@ -0,0 +1 @@ +{"_default": {"1": {"-Serial Number-": "1234", "Brand": "dell", "Grade": "7", "Name": "jb"}}} \ No newline at end of file diff --git a/main.py b/main.py index 3d89285..a89e483 100644 --- a/main.py +++ b/main.py @@ -55,8 +55,9 @@ def main(): if event == 'Add Computer': new_computer = add_computer() existing_table = window["table"].get() - existing_table+= list(new_computer.values()) + existing_table.append( list(new_computer.values())) window["table"].update(existing_table) + db.insert(new_computer) # Finish up by removing from the screen window.close()