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

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-1.0.0.tar.gz (15.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_xworkflows-1.0.0-py2.py3-none-any.whl (16.9 kB view details)

Uploaded Python 2Python 3

File details

Details for the file django_xworkflows-1.0.0.tar.gz.

File metadata

  • Download URL: django_xworkflows-1.0.0.tar.gz
  • Upload date:
  • Size: 15.3 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for django_xworkflows-1.0.0.tar.gz
Algorithm Hash digest
SHA256 b233b5244fb864f95ba935bd3f2214c55600db6294dbca544a6f9eb14918fb06
MD5 0056a1781c087b997e8c8854511608bc
BLAKE2b-256 6658715dc4cd9ddf05f24e53220ca11261c868fe34284f429dc9942340f4c894

See more details on using hashes here.

File details

Details for the file django_xworkflows-1.0.0-py2.py3-none-any.whl.

File metadata

  • Download URL: django_xworkflows-1.0.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 16.9 kB
  • Tags: Python 2, Python 3
  • Uploaded using 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

File hashes

Hashes for django_xworkflows-1.0.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 dc7c68e786b5392abf556f6dcd7182e947f77d1a964043868d4d8615fdd760e4
MD5 b8d3fd9eeb129941e52f13a875e22422
BLAKE2b-256 46288fa4acad62e6951ad102f639f776e4e7e20033787d805fd0d031672886d6

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 files

0.12.3

2 files

0.12.2

2 files

0.12.1

2 files

0.12.0

2 files

0.11.0

2 files

0.10.1

2 files

0.10.0

2 files

0.9.4

1 file

0.9.3

1 file

0.9.2

1 file

0.9.1

1 file

0.9.0

1 file

0.8.1

1 file

0.8.0

1 file

0.7.1

1 file

0.7.0

1 file

0.6.0

1 file

0.5.0

1 file

0.4.5

1 file

0.4.4

1 file

0.4.3

1 file

0.4.2

1 file

0.4.1

1 file

0.4.0

1 file

0.3.1

1 file

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page