#NEWLINE# def take_action( self , action_name , obj_id = None , obj_ids = None ) : #NEWLINE# #INDENT# 'Locates the appropriate action and routes the object\n        data to it. The action should return an HTTP redirect\n        if successful, or a value which evaluates to ``False``\n        if unsuccessful.\n        ' #NEWLINE# obj_ids = ( obj_ids or self . request . POST . getlist ( 'object_ids' ) ) #NEWLINE# action = self . base_actions . get ( action_name , None ) #NEWLINE# if ( ( not action ) or ( action . method != self . request . method ) ) : #NEWLINE# #INDENT# return None #NEWLINE# #UNINDENT# if ( ( not action . requires_input ) or obj_id or obj_ids ) : #NEWLINE# #INDENT# if obj_id : #NEWLINE# #INDENT# obj_id = self . sanitize_id ( obj_id ) #NEWLINE# #UNINDENT# if obj_ids : #NEWLINE# #INDENT# obj_ids = [ self . sanitize_id ( i ) for i in obj_ids ] #NEWLINE# #UNINDENT# if ( not action . handles_multiple ) : #NEWLINE# #INDENT# response = action . single ( self , self . request , obj_id ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if obj_id : #NEWLINE# #INDENT# obj_ids = [ obj_id ] #NEWLINE# #UNINDENT# response = action . multiple ( self , self . request , obj_ids ) #NEWLINE# #UNINDENT# return response #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( action and action . requires_input and ( not ( obj_id or obj_ids ) ) ) : #NEWLINE# #INDENT# messages . info ( self . request , _ ( 'Please select a row before taking that action.' ) ) #NEWLINE# #UNINDENT# #UNINDENT# return None