Skip to main content

Manage all events on workflows

Project description

https://travis-ci.org/unistra/django-workflow-activity.svg?branch=master https://coveralls.io/repos/unistra/django-workflow-activity/badge.svg?branch=master

Install

Install the package via pypi:

pip install django-workflow-activity

Add the installed application in the django settings file:

INSTALLED_APPS = (
    ...
    'workflow_activity'
)

Migrate the database:

python manage.py migrate

Usage

To create workflows and permissions, see the following documentations:

To use workflow activity methods on a class :

from workflow_activity.models import WorkflowManagedInstance

class MyClass(WorkflowManagedInstance):
    ...

To add a workflow to an object:

myobj = MyClass()
myobj.set_workflow('My workflow')

Now, you can use methods on your object like:

myobj.last_state()
myobj.last_transition()
myobj.last_actor()
myobj.last_action()
myobj.allowed_transitions(request.user)
myobj.is_editable_by(request.user, permission='edit')
myobj.state()
myobj.change_state(transition, request.user)
...

And managers like:

MyClass.objects.filter()
MyClass.pending.filter()
MyClass.ended.filter()
...

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-workflow-activity-1.0.5.tar.gz (6.3 kB view details)

Uploaded Source

File details

Details for the file django-workflow-activity-1.0.5.tar.gz.

File metadata

File hashes

Hashes for django-workflow-activity-1.0.5.tar.gz
Algorithm Hash digest
SHA256 aa8ad5a9ec05a183b93bf424af1f6605db410770d6ae4f6611b8809b8e057723
MD5 755b4165b1110b2d0a06c02a4c52a8ab
BLAKE2b-256 c055259b2c2883feddc18c356ef3d79250e9fa3c89ece80c9f3b35305b39045b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page