@forum.route('/post/<int:post_id>')
def view_post(post_id):
 post = Post.query.filter_by(id=post_id).first_or_404()
 post_in_topic = Post.query.filter((Post.topic_id == post.topic_id), (Post.id <= post_id)).order_by(Post.id.asc()).count()
 page = math.ceil((post_in_topic / float(flaskbb_config['POSTS_PER_PAGE'])))
 return redirect((post.topic.url + ('?page=%d#pid%s' % (page, post.id))))

@ forum . route ( '/post/<int:post_id>' ) def view_post ( post_id ) : post = Post . query . filter_by ( id = post_id ) . first_or_404 ( ) post_in_topic = Post . query . filter ( ( Post . topic_id == post . topic_id ) , ( Post . id <= post_id ) ) . order_by ( Post . id . asc ( ) ) . count ( ) page = math . ceil ( ( post_in_topic / float ( flaskbb_config [ 'POSTS_PER_PAGE' ] ) ) ) return redirect ( ( post . topic . url + ( '?page=%d#pid%s' % ( page , post . id ) ) ) )
returns post data .