#NEWLINE# @ admin . route ( '/users' , defaults = { #NEWLINE# #INDENT# 'page' : 1 , #NEWLINE# #UNINDENT# } ) #NEWLINE# @ admin . route ( '/users/page/<int:page>' ) #NEWLINE# def users( page ) : #NEWLINE# #INDENT# search_form = SearchForm ( ) #NEWLINE# bulk_form = BulkDeleteForm ( ) #NEWLINE# sort_by = User . sort_by ( request . args . get ( 'sort' , 'name' ) , request . args . get ( 'direction' , 'asc' ) ) #NEWLINE# order_values = '{0} {1}' . format ( sort_by [ 0 ] , sort_by [ 1 ] ) #NEWLINE# paginated_users = User . query . filter ( User . search ( request . args . get ( 'q' , '' ) ) ) . order_by ( User . role . desc ( ) , User . payment_id , text ( order_values ) ) . paginate ( page , 20 , True ) #NEWLINE# return render_template ( 'admin/user/index.jinja2' , form = search_form , bulk_form = bulk_form , users = paginated_users )