#NEWLINE# def get_action( self , action ) : #NEWLINE# #INDENT# '\n        Return a given action from a parameter, which can either be a callable,\n        or the name of a method on the ModelAdmin.  Return is a tuple of\n        (callable, name, description).\n        ' #NEWLINE# if callable ( action ) : #NEWLINE# #INDENT# func = action #NEWLINE# action = action . __name__ #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if hasattr ( self . __class__ , action ) : #NEWLINE# #INDENT# func = getattr ( self . __class__ , func ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# func = self . admin_site . get_action ( action ) #NEWLINE# #UNINDENT# except KeyError : #NEWLINE# #INDENT# return None #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# if hasattr ( func , 'short_description' ) : #NEWLINE# #INDENT# description = func . short_description #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# description = capfirst ( action . replace ( '_' , ' ' ) ) #NEWLINE# #UNINDENT# return ( func , action , description )