A django app enabling Django models to use xworkflows.
Project description
Use XWorkflows along with Django models.
Django-XWorkflows allow to bind a Django model to a workflow, with a few extra features:
Auto-save after transitions
Log each action into the database
Define a workflow and add it to a model:
from django_xworkflows import models as xwf_models class MyWorkflow(xwf_models.Workflow): states = ( ('new', _(u"New")), ('old', _(u"Old")), ) transitions = ( ('get_old', 'new', 'old'), ) initial_state = 'new' class MyModel(xwf_models.WorkflowEnabled): state = xwf_models.StateField(MyWorkflow)
Use the workflow:
>>> obj = MyModel() >>> obj.state # Defaults to the initial_state State('new') >>> # Perform a transition >>> obj.get_old() >>> obj.state State('old') >>> # Object was saved to the database >>> obj.pk 1 >>> # Logs were saved to the database >>> xwf_models.TransitionLog.objects.all() [TransitionLog(MyModel: new -> old at 2012-04-14T12:10:00+0200)]
Links
Package on PyPI: http://pypi.python.org/pypi/django-xworkflows
Repository and issues on GitHub: http://github.com/rbarrois/django_xworkflows
XWorkflows on GitHub: http://github.com/rbarrois/xworkflows
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
django-xworkflows-0.7.1.tar.gz
(22.4 kB
view details)
File details
Details for the file django-xworkflows-0.7.1.tar.gz
.
File metadata
- Download URL: django-xworkflows-0.7.1.tar.gz
- Upload date:
- Size: 22.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 06868e7d2224ff7a10c500fe8ff2258e3b564fa5337f5babfa33878981be7c9e |
|
MD5 | 54c35f77609fa984fdcf99ee912a283b |
|
BLAKE2b-256 | 80d0d883a2b0fc14e468ef106297f15973536f211cdbaad62907f41f3380b219 |