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.9.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.0.9-py2.py3-none-any.whl (10.1 kB view details)

Uploaded Python 2Python 3

File details

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

File metadata

File hashes

Hashes for django-workflow-activity-1.0.9.tar.gz
Algorithm Hash digest
SHA256 8fb4bbf3e712cba329349358b790fbb5d411f6e1efd5fe4f8605c0f12ffdb173
MD5 c4191073201109dc5342fd1cf8e55de8
BLAKE2b-256 d41c78f3f6ab1eb3ed72556ed018d53d20301475e14c39156198fdabc94b853f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for django_workflow_activity-1.0.9-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 48d6d83faa0ecac0fbb1f95bb66474c661fd1329d235ebb011cab9dcd953d8a8
MD5 fad3c3aebf1ba4a9412ab83181322b3b
BLAKE2b-256 5c30c38d9432cde1a58ff87a2ed026489004b5fee62dc3bdc3f8169311b05bad

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