From 7cc501c5efde9da7c5e4dbfd854cdeb80a8e0ce9 Mon Sep 17 00:00:00 2001 From: jwansek Date: Sat, 6 Mar 2021 01:50:05 +0000 Subject: added twitter on index page --- database.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'database.py') 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_)) -- cgit v1.2.3