No project description provided
Project description
Django Workflow Engine
django-workflow-engine
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 workflows.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": "your_app.workflows.onboard_contractor",
"onboard_perm": "your_app.workflows.onboard_perm",
}
Each entry needs to be a valid module path where the final component is the name of your workflow class.
Finally, run the django-workflow-engine
migrations:
$ ./manage.py migrate
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
Built Distribution
File details
Details for the file django_workflow_engine-0.2.2.tar.gz
.
File metadata
- Download URL: django_workflow_engine-0.2.2.tar.gz
- Upload date:
- Size: 21.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.4 Darwin/23.5.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4bb14dd3d26f15c723f25904e47f212066ebba132c71548093a6cc26551af580 |
|
MD5 | 2b6048a3e1c2a5f47c67941b319433d6 |
|
BLAKE2b-256 | 890ab36b66b713530b9f6d4abbfe346388f3c69126583500c6520cc580ed5cea |
File details
Details for the file django_workflow_engine-0.2.2-py3-none-any.whl
.
File metadata
- Download URL: django_workflow_engine-0.2.2-py3-none-any.whl
- Upload date:
- Size: 40.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.4 Darwin/23.5.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 763559d0c1c7fc3280b729f8f9857b944c2baf518e223a1c747b272bb691d74c |
|
MD5 | 017cc90c38089140e973727dde6b33eb |
|
BLAKE2b-256 | e9677eb7fb84909bf06e1cce63157fa8d7269abaf0446a720eea74f6d814a038 |