dfsfds
This commit is contained in:
parent
c645afc085
commit
e455a6914c
1 changed files with 3 additions and 3 deletions
|
@ -341,17 +341,17 @@ class User(Base):
|
||||||
@property
|
@property
|
||||||
@lazy
|
@lazy
|
||||||
def unread_notifications(self):
|
def unread_notifications(self):
|
||||||
return g.db.query(Notification.id).options(lazyload('*')).filter(Notification.user_id == self.id, Notification.read == False)
|
return g.db.query(Notification.id).options(lazyload('*')).filter(Notification.user_id == self.id, Notification.read == False).join(Notification.comment)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@lazy
|
@lazy
|
||||||
def notifications_count(self):
|
def notifications_count(self):
|
||||||
return self.unread_notifications.count()
|
return self.unread_notifications.filter(Comment.is_banned == False, Comment.deleted_utc == 0).count()
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@lazy
|
@lazy
|
||||||
def post_notifications_count(self):
|
def post_notifications_count(self):
|
||||||
return self.unread_notifications.join(Notification.comment).filter(Comment.author_id == AUTOJANNY_ACCOUNT).count()
|
return self.unread_notifications.filter(Comment.author_id == AUTOJANNY_ACCOUNT).count()
|
||||||
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue