of the Workflow object to the middleware. Now, views that should have access to a Workflow object can do so by calling request.pyworkflow.method_or_attr.
The middleware has a few exceptions. Namely, it:
Only runs on routes matching /workflow/ and /node/
and excludes the /workflow/new and the /workflow/open routes (those are still handled in views)
Other notes
This moves the retrieve_nodes_for_user route (the one that assembles the Node classes into a JSON object) from the Workflow app --> the vp app. The main reason was to prevent more special cases for the middleware to handle, but I think it also makes sense in terms of app separation. Installed nodes should belong to the 'vp' app overall, not defined in a specific workflow (although we haven't reached custom nodes yet). The front-end call was changed to hit /nodes.
These changes do not include saving the visual workflow from the front-end in the session. While it should now be an easy addition, I wanted to make sure the middleware didn't break the existing functionality before making additional changes.
Notes on middleware
This moves the loading
and saving
of the Workflow object to the middleware. Now, views that should have access to a Workflow object can do so by calling
request.pyworkflow.method_or_attr
.The middleware has a few exceptions. Namely, it:
/workflow/
and/node/
/workflow/new
and the/workflow/open
routes (those are still handled in views)Other notes
This moves the
retrieve_nodes_for_user
route (the one that assembles the Node classes into a JSON object) from the Workflow app --> the vp app. The main reason was to prevent more special cases for the middleware to handle, but I think it also makes sense in terms of app separation. Installed nodes should belong to the 'vp' app overall, not defined in a specific workflow (although we haven't reached custom nodes yet). The front-end call was changed to hit/nodes
.These changes do not include saving the visual workflow from the front-end in the session. While it should now be an easy addition, I wanted to make sure the middleware didn't break the existing functionality before making additional changes.