Skip to main content
https://secure.travis-ci.org/rbarrois/django_xworkflows.png?branch=master Latest Version Supported Python versions Wheel status License

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 import models
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, models.Model):

    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)]

Release files for django-xworkflows 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-xworkflows 1.0.0
File Size Uploaded
django_xworkflows-1.0.0.tar.gz 15.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for django-xworkflows 1.0.0
File Interpreter ABI Platform
django_xworkflows-1.0.0-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 32.2 kB

Release files / django_xworkflows-1.0.0.tar.gz

Download URL django_xworkflows-1.0.0.tar.gz
Size 15.3 kB
Tags Source
SHA-256 checksum
How to use checksums
b233b5244fb864f95ba935bd3f2214c55600db6294dbca544a6f9eb14918fb06
BLAKE2b-256 checksum
How to use checksums
6658715dc4cd9ddf05f24e53220ca11261c868fe34284f429dc9942340f4c894
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.0.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.6.9

Release files / django_xworkflows-1.0.0-py2.py3-none-any.whl

Download URL django_xworkflows-1.0.0-py2.py3-none-any.whl
Size 16.9 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
dc7c68e786b5392abf556f6dcd7182e947f77d1a964043868d4d8615fdd760e4
BLAKE2b-256 checksum
How to use checksums
46288fa4acad62e6951ad102f639f776e4e7e20033787d805fd0d031672886d6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.0.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.6.9

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

0.12.0

2 release files

0.11.0

2 release files

0.10.1

2 release files

0.10.0

2 release files

0.9.4

1 release file

0.9.3

1 release file

0.9.2

1 release file

0.9.1

1 release file

0.9.0

1 release file

0.8.1

1 release file

0.8.0

1 release file

0.7.1

1 release file

0.7.0

1 release file

0.6.0

1 release file

0.5.0

1 release file

0.4.5

1 release file

0.4.4

1 release file

0.4.3

1 release file

0.4.2

1 release file

0.4.1

1 release file

0.4.0

1 release file

0.3.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page