Document workflows

Coaster provides versions of the main Docflow classes where workflow exceptions map to HTTP 403 Forbidden (via werkzeug.exceptions.Forbidden).

class coaster.docflow.WorkflowState(value, title=u'', description=u'')

State in a workflow.

class coaster.docflow.WorkflowStateGroup(value, title=u'', description=u'')

Group of states in a workflow. The value parameter is a list of values or WorklowState instances.

class coaster.docflow.InteractiveTransition(workflow)

Multipart workflow transitions. Subclasses of this class may provide methods to return a form, validate the form and submit the form. Implementing a submit() method is mandatory. submit() will be wrapped by the transition() decorator to automatically update the document’s state value.

Instances of InteractiveTransition will receive workflow and document attributes pointing to the workflow instance and document respectively.

validate()

Validate self.form, assuming Flask-WTF Form

class coaster.docflow.DocumentWorkflow(document, context=None)

Base class for document workflows.

permissions()

Permissions for this workflow. Plays nice with coaster.views.load_models() and coaster.sqlalchemy.PermissionMixin to determine the available permissions to the current user.