#NEWLINE# @ viewer . view ( 'show_postlist_by_username' ) #NEWLINE# def show_postlist_by_username( username , page = 1 ) : #NEWLINE# #INDENT# 'Render a post list filtered by username' #NEWLINE# userobj = User . query . filter ( ( User . username == username ) ) . first ( ) #NEWLINE# if ( userobj is None ) : #NEWLINE# #INDENT# abort ( 404 ) #NEWLINE# #UNINDENT# p_filter = ( Post . user == userobj ) #NEWLINE# p_order = Post . pubdate . desc ( ) #NEWLINE# posts = get_posts ( p_filter , p_order ) #NEWLINE# title = ( 'Posts by %s' % username ) #NEWLINE# paginator = Paginator ( posts , app . config [ 'ENTRIES_PER_PAGE' ] , page , 'show_postlist_by_username' , username = username ) #NEWLINE# return viewer . render ( 'post_list.html' , posts = posts , paginator = paginator , title = title )