diff --git a/db.py b/db.py index 237265c..11bfd12 100644 --- a/db.py +++ b/db.py @@ -287,7 +287,8 @@ class DataBase(): return all_topsets def get_tags_for_person(self, person_id): - return self.execute(""" + # Fetch tags from the database + tags = self.execute(""" SELECT T.tag_id as "tag_id", T.person_id as "person_id", @@ -298,7 +299,17 @@ class DataBase(): WHERE T.person_id = %s ORDER BY - T.name""", [person_id]) + T.name + """, [person_id]) + + # Add the static 'All' entry at the beginning + all_tag = { + "tag_id": -1, # No specific ID for 'All' + "person_id": person_id, + "tag_name": "All", # Static name + "tag_filter": "" # No filter + } + return [all_tag] + tags def add_or_update_tag_for_person(self, person_id, tag_name, tag_filter): # check if a tag exists for dashboard with the same tag_name