#NEWLINE# def __init__( self , **kwargs ) : #NEWLINE# #INDENT# super ( BatchAction , self ) . __init__ ( ** kwargs ) #NEWLINE# action_present_method = False #NEWLINE# if hasattr ( self , 'action_present' ) : #NEWLINE# #INDENT# if callable ( self . action_present ) : #NEWLINE# #INDENT# action_present_method = True #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# warnings . warn ( DeprecationWarning ( ( 'The %s BatchAction class must have an action_present method instead of attribute.' % self . __class__ . __name__ ) ) ) #NEWLINE# #UNINDENT# #UNINDENT# action_past_method = False #NEWLINE# if hasattr ( self , 'action_past' ) : #NEWLINE# #INDENT# if callable ( self . action_past ) : #NEWLINE# #INDENT# action_past_method = True #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# warnings . warn ( DeprecationWarning ( ( 'The %s BatchAction class must have an action_past method instead of attribute.' % self . __class__ . __name__ ) ) ) #NEWLINE# #UNINDENT# #UNINDENT# action_methods = ( action_present_method and action_past_method ) #NEWLINE# has_action_method = ( action_present_method or action_past_method ) #NEWLINE# if ( has_action_method and ( not action_methods ) ) : #NEWLINE# #INDENT# raise NotImplementedError ( ( 'The %s BatchAction class must have both action_past andaction_present methods.' % self . __class__ . __name__ ) ) #NEWLINE# #UNINDENT# if ( not action_methods ) : #NEWLINE# #INDENT# if ( not kwargs . get ( 'data_type_singular' ) ) : #NEWLINE# #INDENT# raise NotImplementedError ( ( 'The %s BatchAction class must have a data_type_singular attribute when action_past and action_present attributes are used.' % self . __class__ . __name__ ) ) #NEWLINE# #UNINDENT# self . data_type_singular = kwargs . get ( 'data_type_singular' ) #NEWLINE# self . data_type_plural = kwargs . get ( 'data_type_plural' , ( self . data_type_singular + 's' ) ) #NEWLINE# #UNINDENT# self . use_action_method = action_methods #NEWLINE# self . success_url = kwargs . get ( 'success_url' , None ) #NEWLINE# self . verbose_name = kwargs . get ( 'verbose_name' , self . _get_action_name ) #NEWLINE# self . verbose_name_plural = kwargs . get ( 'verbose_name_plural' , ( lambda : self . _get_action_name ( 'plural' ) ) ) #NEWLINE# self . current_present_action = 0 #NEWLINE# self . current_past_action = 0 #NEWLINE# self . success_ids = [ ] #NEWLINE# self . help_text = kwargs . get ( 'help_text' , self . help_text )