示例#1
0
文件: user.py 项目: zeazje/szurubooru
 def favorite_post_count(self) -> int:
     from szurubooru.db import session
     return (session.query(sa.sql.expression.func.sum(1)).filter(
         PostFavorite.user_id == self.user_id).one()[0] or 0)
示例#2
0
文件: user.py 项目: zeazje/szurubooru
 def disliked_post_count(self) -> int:
     from szurubooru.db import session
     return (session.query(sa.sql.expression.func.sum(1)).filter(
         PostScore.user_id == self.user_id).filter(
             PostScore.score == -1).one()[0] or 0)
示例#3
0
文件: user.py 项目: zeazje/szurubooru
 def comment_count(self) -> int:
     from szurubooru.db import session
     return (session.query(sa.sql.expression.func.sum(1)).filter(
         Comment.user_id == self.user_id).one()[0] or 0)