stepsequence.core ================= .. py:module:: stepsequence.core Attributes ---------- .. autoapisummary:: stepsequence.core._T Exceptions ---------- .. autoapisummary:: stepsequence.core.DuplicatedStepError Classes ------- .. autoapisummary:: stepsequence.core.Step stepsequence.core.StepCollection stepsequence.core.StepSequenceRegistry Functions --------- .. autoapisummary:: stepsequence.core.as_step_registry_id Module Contents --------------- .. py:data:: _T .. py:exception:: DuplicatedStepError Bases: :py:obj:`Exception` Common base class for all non-exit exceptions. .. py:function:: as_step_registry_id(cls_name: str, position: int, cls_before: str | None = None, cls_after: str | None = None) -> str .. py:class:: Step(title: int | str, origin: str, position: int, cls_after: str | None = None, cls_before: str | None = None) .. py:attribute:: title .. py:attribute:: position .. py:attribute:: origin .. py:attribute:: cls_after :value: None .. py:attribute:: cls_before :value: None .. py:method:: __lt__(other: Step) -> bool .. py:method:: __gt__(other: Step) -> bool .. py:property:: id :type: str Unique ID for a step. .. py:method:: __repr__() -> str .. py:class:: StepCollection .. py:attribute:: _steps :type: list[Step] .. py:method:: _ids() -> set[str] .. py:method:: add(step: Step) -> None .. py:method:: keys() -> set[str] .. py:method:: get(position: int | None = None) -> Step | None .. py:class:: StepSequenceRegistry .. py:attribute:: registry :type: dict[str, StepCollection] .. py:attribute:: flattened_registry :type: dict[str, Step] .. py:method:: get(step_id: str | None = None, cls_name: str | None = None, position: int | None = None) -> Step | None .. py:method:: by_id(step_id: str) -> list[Step] by_id(step_id: None) -> None .. py:method:: register(cls_name: str, position: int, title: str | None = None, cls_before: str | None = None, cls_after: str | None = None) -> Step Registers a step by its position, and the class names that come before and after. .. py:method:: registered_step(position: int, title: str | None = None, cls_before: str | None = None, cls_after: str | None = None) -> collections.abc.Callable[[type[_T]], type[_T]] A decorator to register part of a full step sequence. Use as follows:: @step_sequences.registered_step( 1, _('Confirm'), cls_after='FormSubmission') class MyDBModel(Base, StepsExtension): pass