Skip to main content
Python Software Foundation 20th Year Anniversary Fundraiser  Donate today!

A django app enabling Django models to use xworkflows. Compatible with django 3

Project description 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
>>> # Perform a transition
>>> obj.get_old()
>>> obj.state
>>> # Object was saved to the database
>>> # Logs were saved to the database
>>> xwf_models.TransitionLog.objects.all()
[TransitionLog(MyModel: new -> old at 2012-04-14T12:10:00+0200)]

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for django-xworkflows-3, version
Filename, size File type Python version Upload date Hashes
Filename, size django_xworkflows_3- (17.5 kB) File type Wheel Python version py2.py3 Upload date Hashes View
Filename, size django_xworkflows_3- (17.3 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page