River is an open source workflow framework for Django
which support on
the fly changes instead of hardcoding states, transitions and authorization rules.
The main goal of developing this framework is to be able to edit any workflow item on the fly. This means that all the elements in a workflow like states, transitions or authorizations rules are editable at any time so that no changes requires a re-deploying of your application anymore.
Playground: There is a fake jira example repository as a playground of django-river. https://github.com/javrasya/fakejira
Online documentation is available at http://django-river.rtfd.org/.
- Python (
2.7
,3.4
,3.5
,3.6
) - Django (
1.11
,2.0
,2.1
,2.2
) Django
>= 2.0 is supported forPython
>= 3.5
Install and enable it
pip install django-river
INSTALLED_APPS=[ ... river ... ]
Create your first state machine in your model and migrate your db
from django.db import models from river.models.fields.state import StateField class MyModel(models.Model): my_state_field = StateField()
Create all your
states
on the admin pageCreate a
workflow
with your model (MyModel
-my_state_field
) information on the admin pageCreate your
transition approval metadata
within the workflow created earlier and authorization rules along with their priority on the admin pageEnjoy your
django-river
journey.my_model=MyModel.objects.get(....) my_model.river.my_state_field.approve(as_user=transactioner_user) my_model.river.my_state_field.approve(as_user=transactioner_user, next_state=State.objects.get(label='re-opened')) # and much more. Check the documentation
Note
Whenever a model object is saved, it's state field will be initialized with the
state is given at step-4 above by django-river
.
Contributions are welcome! Please join making always totally free django-river
better.