(self, state, model=None)
Set the current state.
        Args:
            state (str or Enum or State): value of state to be set
            model (optional[object]): targeted model; if not set, all models will be set to 'state'
Set the current state.
        Args:
            state (str or Enum or State): value of state to be set
            model (optional[object]): targeted model; if not set, all models will be set to 'state'
Set the current state . Args : state ( str or Enum or State ) : value of state to be set model ( optional [ object ] ) : targeted model ; if not set all models will be set to state
def set_state(self, state, model=None):
        """
            Set the current state.
        Args:
            state (str or Enum or State): value of state to be set
            model (optional[object]): targeted model; if not set, all models will be set to 'state'
        """
        if not isinstance(state, State):
            state = self.get_state(state)
        models = self.models if model is None else listify(model)

        for mod in models:
            setattr(mod, self.model_attribute, state.value)
def set_state ( self , state , model = None ) : if not isinstance ( state , State ) : state = self . get_state ( state ) models = self . models if model is None else listify ( model ) for mod in models : setattr ( mod , self . model_attribute , state . value )