问题
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?
回答1:
Looks like you missed @flow_start_signal
decorator
http://docs.viewflow.io/viewflow_core_node.html#viewflow.nodes.StartSignal
来源:https://stackoverflow.com/questions/53980834/viewflow-start-process-with-django-model-post-save-signal