diff options
author | Louie S <louie@example.com> | 2023-09-16 09:36:14 -0400 |
---|---|---|
committer | Louie S <louie@example.com> | 2023-09-16 09:36:14 -0400 |
commit | 7b680d73f75dfc0f0c057e948994159ed055073a (patch) | |
tree | c8b0ec1bb61f7be97cef715681d6343fee872743 /edit_group_form.py | |
parent | 11db353ea4cac33caccb005be7d4b72671f20ad9 (diff) |
Edit/update group information
Diffstat (limited to 'edit_group_form.py')
-rw-r--r-- | edit_group_form.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/edit_group_form.py b/edit_group_form.py index d5df4c8..aba5559 100644 --- a/edit_group_form.py +++ b/edit_group_form.py @@ -5,6 +5,7 @@ from PyQt5.QtCore import Qt from add_entry_form import Globals from group import Group +DB = __import__("db_sqlite") class editGroupForm(QDialog): """ @@ -70,7 +71,14 @@ class editGroupForm(QDialog): QMessageBox.Close) return - # TODO do the database stuff (this will allow us to get the id) + # Update DB + group = list(filter(lambda g: g.id == self.id, Globals.groups))[0] + group.name = name_text + group.column = column_text + group.link = link_text + DB.updateGroup(group) + + # Update global variables Globals.groups = list(filter(lambda g: g.id != self.id, Globals.groups)) Globals.groups.append(Group(self.id, name_text, column_text, link_text)) self.close() |