about summary refs log tree commit diff
path: root/src/db_handler.py
diff options
context:
space:
mode:
authoruser@node5.net <user@node5.net>2025-07-19 15:18:48 +0200
committeruser@node5.net <user@node5.net>2025-07-19 15:18:48 +0200
commit1de5e27008b309a352f5c967dce253d956e40421 (patch)
tree0123534dad29b3c56d3b6d88c55f8cdc4d4b7698 /src/db_handler.py
parentddcc24426fbc870d1017d1cf2cf7636936845d18 (diff)
Comment section ascii table
Diffstat (limited to 'src/db_handler.py')
-rw-r--r--src/db_handler.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/db_handler.py b/src/db_handler.py
index 673431d..c52d667 100644
--- a/src/db_handler.py
+++ b/src/db_handler.py
@@ -17,12 +17,12 @@ class DBHandler:
             cur = con.cursor()
             cur.execute(
                 '''
-                SELECT id, comment, page_url, visitor_url, nickname,
-                (CASE WHEN show_contact THEN contact ELSE NULL END) as contact, created_at
+                SELECT id, nickname, comment, page_url, visitor_url, (CASE WHEN show_contact THEN contact ELSE NULL END) as contact, created_at
                 FROM comment WHERE approved AND public AND page_url = ? ORDER BY created_at DESC;
                 ''', (url))
             comments = cur.fetchall()
-            return comments
+            headers = list(map(lambda attr : attr[0], cur.description))
+            return comments, headers
 
 
     def post_comment(self, comment: str, page_url: str, visitor_url: str=None, nickname: str=None, contact: str=None,