Viewflow - start process with Django model post_save signal
Asked Answered
K

1

0

Is there a way to start a Viewflow process with Django model post_save signal. I managed to do this:

//start viewflow process
start = (
    flow.StartSignal(post_save, create_dest_flow)
        .Next(this.approve)
)

//create flow function
def create_dest_flow(**kwargs):
   print("Test")
   pass

The "Test" string is printed for every save on any model. If I add activation to the create flow function parameteres I get an error: missing 1 required positional argument: 'activation'. How to start the flow only on specific model post_save signal?

Kempis answered 30/12, 2018 at 19:39 Comment(0)
S
1

Looks like you missed @flow_start_signal decorator

http://docs.viewflow.io/viewflow_core_node.html#viewflow.nodes.StartSignal

Skewback answered 4/1, 2019 at 6:40 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.