spaghetti

This commit is contained in:
Aevann1 2022-04-03 20:01:11 +02:00
parent ab9a7ada92
commit 37d32453d4
2 changed files with 7 additions and 2 deletions

View file

@ -418,6 +418,11 @@ class User(Base):
def post_notifications_count(self):
return g.db.query(Notification.user_id).join(Comment).filter(Notification.user_id == self.id, Notification.read == False, Comment.author_id == AUTOJANNY_ID).count()
@property
@lazy
def reddit_notifications_count(self):
return g.db.query(Notification.user_id).join(Comment).filter(Notification.user_id == self.id, Notification.read == False, Comment.author_id == AUTOJANNY_ID, Comment.body_html.like('<html><body><p>New rdrama mention: <a href="https://old.reddit.com/r/%')).count()
@property
@lazy
def not_post_notifications_count(self):