I've got a Django App where I need to follow different workflow for different inputs.
I receive an input parameter with the data payload over the POST
endpoint. Based on the input, I need to fire different functions, process the data accordingly and finally save it in the data store.
One option is to write if-else
, however writing if-else
is difficult in maintaining as the code grows.
For eg:-
If input1, then function1(), process1(), save1()
elif input2, then function2(), process2(), save2()
I've looked into Intellect, django-viewflow and many other business-rule libraries, but not sure about the recommended way of doing it.
It'll be helpful if anyone can provide me a dummy example or an open-source project via which I can understand the implementation of the same.