Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/unistra/django-workflow-activity
django workflow activity
https://github.com/unistra/django-workflow-activity
Last synced: 10 days ago
JSON representation
django workflow activity
- Host: GitHub
- URL: https://github.com/unistra/django-workflow-activity
- Owner: unistra
- License: gpl-2.0
- Created: 2015-06-18T10:11:16.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2021-04-29T08:22:37.000Z (over 3 years ago)
- Last Synced: 2024-10-21T15:51:22.709Z (27 days ago)
- Language: Python
- Homepage:
- Size: 34.2 KB
- Stars: 9
- Watchers: 22
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
django-workflow-activity
========================
.. image:: https://travis-ci.org/unistra/django-workflow-activity.svg?branch=master
:target: https://travis-ci.org/unistra/django-workflow-activity.. image:: https://coveralls.io/repos/unistra/django-workflow-activity/badge.svg?branch=master
:target: https://coveralls.io/r/unistra/django-workflow-activity?branch=masterInstall
-------Install the package via pypi: ::
pip install django-workflow-activityAdd 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:
- https://pythonhosted.org/django-workflows
- https://pythonhosted.org/django-permissionsTo 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()
...