#NEWLINE# def index( self ) : #NEWLINE# #INDENT# session [ ( '%s.index' % self . get_admin_name ( ) ) ] = request . url #NEWLINE# query = self . get_query ( ) #NEWLINE# ordering = ( request . args . get ( 'ordering' ) or '' ) #NEWLINE# query = self . apply_ordering ( query , ordering ) #NEWLINE# ( filter_form , query , cleaned , field_tree ) = self . process_filters ( query ) #NEWLINE# pq = PaginatedQuery ( query , self . paginate_by ) #NEWLINE# if ( request . method == 'POST' ) : #NEWLINE# #INDENT# id_list = request . form . getlist ( 'id' ) #NEWLINE# if ( request . form [ 'action' ] == 'delete' ) : #NEWLINE# #INDENT# return redirect ( url_for ( self . get_url_name ( 'delete' ) , id = id_list ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return redirect ( url_for ( self . get_url_name ( 'export' ) , id = id_list ) ) #NEWLINE# #UNINDENT# #UNINDENT# return render_template ( self . templates [ 'index' ] , model_admin = cleaned , query = pq , ordering = ordering , filter_form = filter_form , field_tree = field_tree , active_filters = cleaned , ** self . get_extra_context ( ) )