コード例 #1
0
ファイル: comment.py プロジェクト: guzhiyiai/flask-blog
    def get_comments_count(post_id):

        comments_count = get_counter(POST_COMMENTS_COUNT, post_id=post_id)

        if comments_count is not None:
            comments_count = Comment.query.filter_by(post_id=post_id).count()
        return comments_count
コード例 #2
0
ファイル: comment.py プロジェクト: yu-chun-yu/flask_blog-1
    def get_comments_count(post_id):

        comments_count = get_counter(POST_COMMENTS_COUNT, post_id=post_id)

        if comments_count is not None:
            comments_count = Comment.query.filter_by(post_id=post_id).count()
        return comments_count
コード例 #3
0
ファイル: comment.py プロジェクト: guzhiyiai/flask-blog
 def inc_comments_count(post_id):
     comments_count = get_counter(POST_COMMENTS_COUNT, post_id=post_id)
     if comments_count is None:
         CommentService.set_comments_count(post_id)
     else:
         inc_counter(POST_COMMENTS_COUNT, post_id=post_id)
コード例 #4
0
ファイル: comment.py プロジェクト: yu-chun-yu/flask_blog-1
 def inc_comments_count(post_id):
     comments_count = get_counter(POST_COMMENTS_COUNT, post_id=post_id)
     if comments_count is None:
         CommentService.set_comments_count(post_id)
     else:
         inc_counter(POST_COMMENTS_COUNT, post_id=post_id)