Beispiel #1
0
def remove_post_from_feed(post_id, author_id):
    post = Post.get(post_id)
    remove_post_from_feed_(post, author_id)
    logger.info(
        f"remove_post_from_feed post_id={post_id}, author_id={author_id}")
Beispiel #2
0
def add_to_activity_feed(post_id):
    post = Post.get(post_id)
    ActivityFeed.add(int(post.created_at.strftime("%s")), post_id)
    logger.info(f"add_to_activity_feed post_id={post_id}")
Beispiel #3
0
def add_to_activity_feed(post_id):
    """ 把热门文章加入到`ACTIVITY_KEY`流中 """
    post = Post.get(post_id)
    ActivityFeed.add(int(post.created_at.timestamp()), post_id)
Beispiel #4
0
def feed_post(post_id):
    post = Post.get(post_id)
    feed_post_(post)
    logger.info(f"feed post post_id={post_id}")
Beispiel #5
0
def post(identifier):
    post = Post.get(identifier)
    return render_template("post.html", post=post)
Beispiel #6
0
 def _prepare(self, post_id):
     post = Post.get(post_id)
     if not post:
         raise ApiException(httperrors.post_not_found.value)
     return post
Beispiel #7
0
def add_to_activity_feed(post_id):
    post = Post.get(post_id)

    ActivityFeed.add(int(post.created_at.strftime('%s')), post_id)
    logger.info(f'Add_to_activity_feed post_id:{post_id}')
Beispiel #8
0
def feed_post(id):
    post = Post.get(id)
    _feed_post(post)
    logger.info(f'Feed_post {id}')
Beispiel #9
0
def remove_post_from_feed(post_id, author_id):
    post = Post.get(post_id)
    _remove_post_from_feed(post, author_id)
    logger.info(
        f'Remove_post_from_feed post_id:{post_id}, author_id: {author_id}')