Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/datakurre/pyramid_workflow

A Pyramid-only fork of substanced.workflow
https://github.com/datakurre/pyramid_workflow

Last synced: about 2 months ago
JSON representation

A Pyramid-only fork of substanced.workflow

Awesome Lists containing this project

README

        

pyramid_workflow
================

.. image:: https://secure.travis-ci.org/datakurre/pyramid_workflow.png
:target: http://travis-ci.org/datakurre/pyramid_workflow

This package is a shameless derivate of ``substanced.workflow`` module without
``substanced`` dependencies (besides its LICENSE, of course).

Differences from ``substanced.workflow``:

- workflow requires ``state_attr`` as its first positional argument
similarly to the original ``repoze.workflow`` (and because of that
parallel workflows should use different ``state_attr``)

- content-type related checks are removed, because there's no more
global content registry (``substanced.content``).

Example of use:

.. code:: python

from pyramid_workflow import Workflow

task_workflow = Workflow(state_attr='task_state',
initial_state='new',
type='task')

task_workflow.add_state('new')
task_workflow.add_state('working')
task_workflow.add_state('done')

task_workflow.add_transition('start',
from_state='new',
to_state='working')
task_workflow.add_transition('complete',
from_state='working',
to_state='done')
task_workflow.add_transition('abort',
from_state='working',
to_state='new')

def includeme(config):
config.add_workflow(task_workflow, content_types=('my_type',))

See also: http://substanced.readthedocs.org/en/latest/workflows.html