vikingco/django-states2 — pull request #48 by NickPresta (2013-11-27 20:59:22+00:00)
Title: [Feature] Multi-database support

I've added support for multiple databases. We needed this for my work at Wave (https://github.com/waveaccounting) where we have many models that are on different databases (shards).

## Problem

You have models that aren't on the default database.

## Solution

Support multi-database as implemented in Django (specify `using` when saving, filter, creating, etc).

### How to use

In your model, define a `get_using_db()` method. This will return the name of the database to use. The rest is handled internally.

## Assumptions

The only real assumption I made was that your logs will be on the same database as your main model. In my specific application this is true - related data to the main model are on the same database for access reasons.