Пример #1
0
    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
    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
 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
 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)