-1

I am designing an API-first application, which will obviously not use the Django templating system but instead will use just DRF and a React frontend.

Viewflow Pro has an API endpoint mechanism, and also I seem to understand (but I'm not entirely sure, so that's a separated question) that you need Viewflow Pro just because you are designing a commercial application and not an open source one.

I would like to understand if I need to use the Viewflow REST endpoints or if I could use my DRF generics viewsets integrated for viewflow.

As a theoretical example: I have an APIView that exposes a change of state, and depending on the user which triggers the change of state, Viewflow helps me dispatching the proper "link" to another endpoint and/or APIView which is appropriated for the flow.

So instead of going to /myviewflowendpoint/state/change just going to a regular /my/foo/endpoint and put the viewflow logic programmatically inside that view. Is this possible? Is there something similar on the cookbook?

superandrew
  • 1,741
  • 19
  • 35

1 Answers1

0

Viewflow is the thin workflow layer on top of django model-view-template. Viewflow extracts flow logic out of view. Viewflow allows changing flow without views code and URL config modifications.

Calling a flow from a view returns flow logic back to a view just complicates your code with no profit.

kmmbvnr
  • 5,863
  • 4
  • 35
  • 44
  • Thank you @kmmbvnr, then I'm struggling to understand why viewflow exposes APIs (and I'm sure it's me not knowing things enough about workflows, but still). I thought it was to move processes states, but maybe is for changing the flows programmatically via REST? As said before, probably I am missing something, but maybe the viewflow documentation could be improved in some ways (just my opinion, of course). I have a clear understanding of how viewflow could help me on a high level, from a process perspective, but I am hardly trying to understand the Django flow of it. – superandrew Apr 29 '19 at 10:06