Manage all events on workflows
Project description
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Close
Hashes for django-workflow-activity-1.0.7.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 67b60efedd76d98f7af8baef9a699df7739b2718e5ed9efbc2a5c83b7543b8e6 |
|
MD5 | 0b7a6eed0be0399c5f9bc97e9d770bc7 |
|
BLAKE2b-256 | 06fd95092ba3763e1858b8cfa16e9629e3d30caa3cd08b8791753ee79d48b94f |