Raised when a transition is not allowed.
State(states: Any, default: Any | None = None)¶
State slot field.
transition(self, source: Any, target: Any | None = None, label: str | None = None, conditions: List[ThisObject | Callable[[object, object], bool]] | None = None, permission: ThisObject | Callable[[object, Any], bool] | None = None) Any ¶
Transition method decorator.
alias of ANY
CONDITION(is_true: bool, unmet: str = '')¶
Boolean-like object to return value accompanied with a message from fsm conditions.
A Mixin for providing Finite State Machine (FSM) management support in Django admin.
chart(flow_state: StateDescriptor, exclude_guards=True)¶
Draws a directed graph (digraph) of the state transitions defined in the given flow_state.
The function uses the flow_state object to extract the transitions and the states involved. It then generates a DOT language string, which can be used with tools like Graphviz to produce an image of the graph.
Note that the function ignores the State.USE_RETURN_VALUE and State.SELECT states for now, as these are not supported yet.