You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A ModelView that implements views for transitions has to do it the manual way: by specifying a route for every transition, each decorated with requires_roles (#179). We currently use a catch all transition view, which cannot benefit from is_available (#217). Instead, the following syntax would be nice:
TransitionView constructs a class with a collection of view methods for each of the transitions in the state manager, each of which is decorated with @route (as a POST request) and @requires_roles using the same roles as defined in the source transition. The view performs a CSRF check before calling the transition.
forms, a dictionary of {transition_name: form}. The form is used to process data from the request and the fields are passed in to the transition as keyword parameters.
exclude a list of transition names for which views should not be constructed
include overrides exclude to limit construction to the specified names
The text was updated successfully, but these errors were encountered:
A ModelView that implements views for transitions has to do it the manual way: by specifying a route for every transition, each decorated with
requires_roles
(#179). We currently use a catch alltransition
view, which cannot benefit fromis_available
(#217). Instead, the following syntax would be nice:TransitionView
constructs a class with a collection of view methods for each of the transitions in the state manager, each of which is decorated with@route
(as a POST request) and@requires_roles
using the same roles as defined in the source transition. The view performs a CSRF check before calling the transition.This guide explains how such classes can be constructed in Python.
TransitionView can take optional parameters:
prefix
, a string prefix for view namessuffix
, a string suffix for view namesforms
, a dictionary of{transition_name: form}
. The form is used to process data from the request and the fields are passed in to the transition as keyword parameters.exclude
a list of transition names for which views should not be constructedinclude
overridesexclude
to limit construction to the specified namesThe text was updated successfully, but these errors were encountered: