aboutsummaryrefslogtreecommitdiffstats
path: root/database.py
diff options
context:
space:
mode:
authorjwansek <eddie.atten.ea29@gmail.com>2021-03-06 01:50:05 +0000
committerjwansek <eddie.atten.ea29@gmail.com>2021-03-06 01:50:05 +0000
commit7cc501c5efde9da7c5e4dbfd854cdeb80a8e0ce9 (patch)
treed44c8d2ece059ba9e3f497b95817380e0d19cf1b /database.py
parent287034916bef5878a5565aec4141216fa6f133e6 (diff)
downloadboymoder.blog-7cc501c5efde9da7c5e4dbfd854cdeb80a8e0ce9.tar.gz
boymoder.blog-7cc501c5efde9da7c5e4dbfd854cdeb80a8e0ce9.zip
added twitter on index page
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_))