Add All tag to dashboard as well
This commit is contained in:
12
db.py
12
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
|
||||
|
||||
Reference in New Issue
Block a user