viewflow.fsm.
TransitionNotAllowed
¶Exception raised when a state transition is not permitted.
viewflow.fsm.
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], bool]] | None = None, permission: ThisObject | Callable[[object, Any], bool] | None = None, custom: Dict | None = None) Any ¶Decorator to mark a method as a state transition.
ANY
¶alias of ANY
CONDITION
(is_true: bool, unmet: str = '')¶Boolean-like object to return value accompanied with a message from fsm conditions.
viewflow.fsm.
FlowAdminMixin
¶A Mixin for providing Finite State Machine (FSM) management support in Django admin.
viewflow.fsm.
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.