re-add subscriptions

This commit is contained in:
2025-07-01 23:20:36 +03:00
parent 52f6484db1
commit 29bb9872d3
7 changed files with 210 additions and 10 deletions

View File

@ -56,6 +56,18 @@ class Users(Model):
WHERE users.id = ?"""
return db.fetch_one(q, self.id)
def get_all_subscriptions(self):
q = """
SELECT threads.title AS thread_title, threads.slug AS thread_slug
FROM
threads
JOIN
subscriptions ON subscriptions.thread_id = threads.id
WHERE
subscriptions.user_id = ?"""
return db.query(q, self.id)
class Topics(Model):
table = "topics"