Lightweight, reusable workflow engine for Django applications
Project description
django-workflow-engine
django-workflow
is a lightweight and reusable workflow engine for
Django applications. It enables you to better organise the business logic for
collaborating users.
Installation
pip install django-workflow-engine
Getting started
Add the application to your Django settings INSTALLED_APPS
list:
INSTALLED_APPS = [
...
"django_workflow_engine",
]
Add the built-in django-workflow-engine
view urls to your project's urls. py
as
follows:
from django_workflow_engine import workflow_urls
...
urlpatterns = [
path("workflow/", workflow_urls()),
...
]
This will utilise all django-workflow-engine
built-in view classes. Default views are:
list_view=FlowListView
List of workflow instances view.view=FlowView
Workflow instance view.create_view=FlowCreateView
Create workflow view.continue_view=FlowContinueView
Workflow continuation view.diagram_view=FlowDiagramView
Workflow diagram view.
You can override any the built-in view classes with your own, for example to provide your own view classes for flow list and flow view:
urlpatterns = [
path("workflow/",
workflow_urls(
list_view=MyFlowListView,
view=MyFlowView,
),
),
]
Building your first workflow
Create a workflow.py
in your project and add your uniquely named workflows.
from django_workflow_engine import Step, Workflow
Onboard_Contractor = Workflow(
name="onboard_contractor",
steps=[
Step(...),
Step(...),
Step(...),
],
)
Onboard_Perm = Workflow(
name="onboard_perm",
steps=[
...
],
)
Add you workflows to your Django settings as follows:
DJANGO_WORKFLOWS = {
"onboard_contractor": Onboard_Contractor,
"onboard_perm": Onboard_Perm,
}
Finally, run the django-workflow-engine
migrations:
$ ./manage.py migrate
Dependencies
Settings
Running tests
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
Hashes for django-workflow-engine-0.0.10.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | a1ec99a7160e55ebda5a73a11c3144313d45498a33d92a99ea8dd1b65055f123 |
|
MD5 | 824685b37d1678f747f4bc7e4800c36b |
|
BLAKE2b-256 | 475f5b61aa3b485fe2c08744c2df10f1a62204148f180cdabedcaad5dad178cf |