Skip to content
This repository has been archived by the owner on Feb 13, 2019. It is now read-only.

theonion/bulbs2-editorial-workflow

Repository files navigation

bulbs2-editorial-workflow Build Status

do not pass go; do not collect $200

bulbs2-editorial-workflow is a companion app to bulbs2 that enforces a specific publishing workflow. The workflow is as follows:

  1. new content is in state draft
  2. draft content can be sent to the editors, moving it to waiting for editor
  3. waiting for editor content can move to: (a) approved for publication status, or (b) be sent back to the author and back to draft status

This is handled through a Finite State Machine. However, approving content for publication does not automatically assign a publication date: that needs to be done separately by the implementation. It also does not contain any logic for notification.

Unlike the base bulbs2, this is opinionated: hence why is is not in the main package. This is specifically what I meant when I said prescriptive code should be refactored to its own repo.

A great example of how this is useful is the distinction of workflow between Onion Studios and The Onion. Both have content that needs to be published (so they would rely on the base bulbs2 dependency), but Onion Studios does not need to have an enforced editorial-approval workflow while The Onion does. So, The Onion would add this as a dependency and Onion Studios would not. Their base content would still have the same mixins, but The Onion would add this to control its approval process.

Getting the Code

You can clone the code via git:

$ git clone https://github.com/theonion/bulbs2-editorial-workflow.git

Alternatively, if you just want to use it in a Django application, you can install it via pip:

$ pip install -e git+https://github.com/theonion/bulbs2-editorial-workflow.git#egg=bulbs2-editorial-workflow

Note: since this is a far-afield project that may or may not be brought to production, I am refraining from adding it to the PyPI index.

Testing the Code

To run the tests, clone the repository from GitHub (see steps above). You should then create a virtual environment with Python 3 and install the project to that:

$ cd /path/to/virtualenvs
$ virtualenv -p python3 bulbs2-editorial-workflow
$ source bulbs2/bin/activate
$ cd /path/to/bulbs2-editorial-workflow
$ python setup.py install
$ pip install -r requirements-dev.txt
$ py.test tests

If you don't have Python 3 on your system, you can brew install it:

$ brew install python3
$ brew linkapps

If you don't have virtualenv on you system, you can pip install that:

$ pip install virtualenv

If you don't have brew installed, you can get that via:

$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

If you don't have pip, install Python 2 and Python 3 via brew:

$ brew install python2 python3
$ brew linkapps

About

do not pass go; do not collect $200

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages