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}")
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}")
def add_to_activity_feed(post_id): """ 把热门文章加入到`ACTIVITY_KEY`流中 """ post = Post.get(post_id) ActivityFeed.add(int(post.created_at.timestamp()), post_id)
def feed_post(post_id): post = Post.get(post_id) feed_post_(post) logger.info(f"feed post post_id={post_id}")
def post(identifier): post = Post.get(identifier) return render_template("post.html", post=post)
def _prepare(self, post_id): post = Post.get(post_id) if not post: raise ApiException(httperrors.post_not_found.value) return post
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}')
def feed_post(id): post = Post.get(id) _feed_post(post) logger.info(f'Feed_post {id}')
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}')