Viewflow Extensions

These are extensions for Django Viewflow.

All Contents

Contents:

Installation

Simply install the latest stable package using the command

pip install viewflow-extensions

and add 'viewflow_extensions' to the INSTALLED_APP setting in your settings.py, that’s it!

Management Commands

create_graph

class viewflow_extensions.management.commands.flow_graph.Command(stdout=None, stderr=None, no_color=False)[source]

Bases: django.core.management.base.BaseCommand

Create graphs from the path to flow class using graphviz.

Example usage:

usage: manage.py flow_graph [--svg] flow_path

Create graph for the given flow.

positional arguments:
  flow_path             complete path to your flow, i.e. myapp.flows.Flow

optional arguments:
  -s, --svg             create graph as svg file

Note

This extensions requires graphviz to be installed.

Sphinx

Sphinx extension to automatically render BPMN graphs of Flows.

Viewflow-Extensions comes with a Sphinx extensions that render BPMN graphs as SVG and automatically attaches them to the documentation of each flow.

To enable this feature simply add viewflow_extensions.sphinx to your Sphinx configuration.

Example:

extensions = [
    'sphinx.ext.autodoc',
    # ...
    'viewflow_extensions.sphinx',
]

Note

This extensions requires graphviz to be installed as well as the Sphinx extension sphinx.ext.autodoc to be enabled.

Views

Views for view nodes that add additional behavior.

Inheritance diagram of viewflow_extensions.views

class viewflow_extensions.views.SavableViewActivationMixin[source]

Bases: object

Add save option to .viewflow.flow.ManagedViewActivation activations.

Usage:

from viewflow.views import ProcessView

class MyCustomView(SavableViewMixin, ProcessView):
    pass

All you have to do is to add a new submit button with the name _save to your template.

Template example:

<button type="submit" name="_save">
  {% trans 'Save' %}
</button>
save_task[source]

Transition to save the task and return to ASSIGNED state.

activation_done(*args, **kwargs)[source]

Complete the activation or save only, depending on form submit.

message_complete()[source]

Disable complete messages if the task was only saved.

get_success_url()[source]

Stay at the same page, if the task was only saved.

Indices and tables