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.1.0.tar.gz (6.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_workflow_activity-1.1.0-py2.py3-none-any.whl (10.1 kB view details)

Uploaded Python 2Python 3

File details

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

File metadata

File hashes

Hashes for django-workflow-activity-1.1.0.tar.gz
Algorithm Hash digest
SHA256 c1b53667992511994746e8ba46b29d6e03205508209ce26ad0d83006df743bce
MD5 fdc85a3f1a68b3a2e5fa14ce0db001c8
BLAKE2b-256 d7cee66f3b2db259ba7853d8b4b3e4b4392b0af4a158a237160713258bafdf94

See more details on using hashes here.

File details

Details for the file django_workflow_activity-1.1.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for django_workflow_activity-1.1.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 56d7d397d0de4832938704ad7733d78b730255497279c44a70d067e2414db65e
MD5 22c8b39226bae17c5c73518aca2ec9c1
BLAKE2b-256 c05d6cc8698e032462ee4e65debbc2a9e3294c9b780af91bb3b00d9bd1d1a6c4

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