(self, state_name, model, allow_substates=False)
return self.get_model_state(model).is_substate_of(state_name)
Extends transitions.core.Machine.is_state with an additional parameter (allow_substates)
            to
        Args:
            state_name (str): Name of the checked state.
            model (class): The model to be investigated.
            allow_substates (bool): Whether substates should be allowed or not.

        Returns: bool Whether the passed model is in queried state (or a substate of it) or not.
Extends transitions.core.Machine.is_state with an additional parameter (allow_substates)
            to
        Args:
            state_name (str): Name of the checked state.
            model (class): The model to be investigated.
            allow_substates (bool): Whether substates should be allowed or not.
Extends transitions . core . Machine . is_state with an additional parameter ( allow_substates ) to Args : state_name ( str ) : Name of the checked state . model ( class ) : The model to be investigated . allow_substates ( bool ) : Whether substates should be allowed or not .
def is_state(self, state_name, model, allow_substates=False):
        """ Extends transitions.core.Machine.is_state with an additional parameter (allow_substates)
            to
        Args:
            state_name (str): Name of the checked state.
            model (class): The model to be investigated.
            allow_substates (bool): Whether substates should be allowed or not.

        Returns: bool Whether the passed model is in queried state (or a substate of it) or not.

        """
        if not allow_substates:
            return getattr(model, self.model_attribute) == state_name

        return self.get_model_state(model).is_substate_of(state_name)
def is_state ( self , state_name , model , allow_substates = False ) : if not allow_substates : return getattr ( model , self . model_attribute ) == state_name return self . get_model_state ( model ) . is_substate_of ( state_name )