(self, state, model)
return getattr(model, self.model_attribute) == state
Check whether the current state matches the named state. This function is not called directly
            but assigned as partials to model instances (e.g. is_A -> partial(_is_state, 'A', model)).
        Args:
            state (str): name of the checked state
            model: model to be checked
        Returns:
            bool: Whether the model's current state is state.
Check whether the current state matches the named state. This function is not called directly
            but assigned as partials to model instances (e.g. is_A -> partial(_is_state, 'A', model)).
        Args:
            state (str): name of the checked state
            model: model to be checked
        Returns:
            bool: Whether the model's current state is state.
Check whether the current state matches the named state . This function is not called directly but assigned as partials to model instances ( e . g . is_A - > partial ( _is_state A model )) . Args : state ( str ) : name of the checked state model : model to be checked Returns : bool : Whether the model s current state is state .
def is_state(self, state, model):
        """ Check whether the current state matches the named state. This function is not called directly
            but assigned as partials to model instances (e.g. is_A -> partial(_is_state, 'A', model)).
        Args:
            state (str): name of the checked state
            model: model to be checked
        Returns:
            bool: Whether the model's current state is state.
        """
        return getattr(model, self.model_attribute) == state
def is_state ( self , state , model ) : return getattr ( model , self . model_attribute ) == state