def get(self, topic_id): topic = Topic.get_by_pk(topic_id) if topic: topic.view_count_inc() count, user_topics = Topic.get_list_by_user(topic.user) user_topics = user_topics.limit(10) follow = JsDict() if self.current_user(): follow.topic = Follow.exists(OBJECT_TYPES.TOPIC, topic_id, self.current_user()) follow.author = Follow.exists(OBJECT_TYPES.USER, topic.user.id, self.current_user()) self.render( "forum/topic.html", nav="index", page_title=page_title(topic.title, topic.board.title, "社区"), topic=topic, user_topics=user_topics, follow=follow, ) else: self.write_error(404)