aboutsummaryrefslogtreecommitdiffstats
path: root/database.py
diff options
context:
space:
mode:
Diffstat (limited to 'database.py')
-rw-r--r--database.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/database.py b/database.py
index 181effb..5e50f82 100644
--- a/database.py
+++ b/database.py
@@ -84,6 +84,11 @@ class Database:
WHERE thought_id = %s;""", (id_, ))
return cursor.fetchone()
+ def get_featured_thoughts(self):
+ with self.__connection.cursor() as cursor:
+ cursor.execute("SELECT thought_id, title FROM thoughts WHERE featured = 1;")
+ return cursor.fetchall()
+
def update_thought_markdown(self, id_, markdown):
with self.__connection.cursor() as cursor:
cursor.execute("UPDATE thoughts SET markdown_text = %s WHERE thought_id = %s;", (markdown, id_))