From f1d2ab3b9bf5bb54f23e7d9ed838e1b2b02b8323 Mon Sep 17 00:00:00 2001 From: mitsuha_s Date: Sat, 28 May 2022 22:47:19 +0000 Subject: [PATCH] add get_users_subscribes method --- database.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/database.py b/database.py index 13ef081..70bc8a0 100644 --- a/database.py +++ b/database.py @@ -41,8 +41,9 @@ class Database(): self.cur.execute('SELECT * FROM feeds') return self.cur.fetchall() - def get_users_subscribes(): - pass + def get_users_subscribes(self, user_id: int) -> list: + self.cur.execute('SELECT * FROM feeds WHERE id IN (SELECT feed_id FROM subscribes WHERE user_id = ?)', (user_id,)) + return self.cur.fetchall() def get_feed_items(): pass