diff --git a/db.py b/db.py index 11bfd12..f841a4a 100644 --- a/db.py +++ b/db.py @@ -328,7 +328,7 @@ class DataBase(): person_id, tag_id], commit=True) def get_tags_for_dashboard(self): - return self.execute(""" + tags = self.execute(""" SELECT T.tag_id AS "tag_id", T.person_id AS "person_id", @@ -340,6 +340,16 @@ class DataBase(): T.person_id IS NULL ORDER BY T.name""", []) + + # Add the static 'All' entry at the beginning + all_tag = { + "tag_id": -1, # No specific ID for 'All' + "person_id": None, + "tag_name": "All", # Static name + "tag_filter": "" # No filter + } + + return [all_tag] + tags def add_or_update_tag_for_dashboard(self, tag_name, tag_filter): # check if a tag exists for dashboard with the same tag_name