Flow InheritanceΒΆ

Flow inheritance allows to override and add additional transitions to a new class.

To keep same state changes but with additional code, use State.super() decorator. To get access to undecorated base method use .original attribute

class MyFlow(object):
    state = fsm.State(Stage, default=Stage.NEW)

    @stage.transition(source=Stage.DONE, target=Stage.HIDDEN)
    def hide():
        print('base hide')

class GuestFlow(MyFlow):
    def hide(self):
        # any additional code here