When on overview page add a static tag that selects everything, will have to refactor tags functionality soon
This commit is contained in:
15
db.py
15
db.py
@@ -287,7 +287,8 @@ class DataBase():
|
|||||||
return all_topsets
|
return all_topsets
|
||||||
|
|
||||||
def get_tags_for_person(self, person_id):
|
def get_tags_for_person(self, person_id):
|
||||||
return self.execute("""
|
# Fetch tags from the database
|
||||||
|
tags = self.execute("""
|
||||||
SELECT
|
SELECT
|
||||||
T.tag_id as "tag_id",
|
T.tag_id as "tag_id",
|
||||||
T.person_id as "person_id",
|
T.person_id as "person_id",
|
||||||
@@ -298,7 +299,17 @@ class DataBase():
|
|||||||
WHERE
|
WHERE
|
||||||
T.person_id = %s
|
T.person_id = %s
|
||||||
ORDER BY
|
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):
|
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
|
# check if a tag exists for dashboard with the same tag_name
|
||||||
|
|||||||
Reference in New Issue
Block a user