ambv/dj.choices — pull request #7 by supervacuo (2013-11-01 12:48:07+00:00)
Title: Support JSON encoding of ChoiceFields

Python's `json` module calls `str()` on values which are instances of `int` (`json/encoder.py`):

```python
426 elif isinstance(o, (int, long)):
426 yield str(o)
```

This commit defines `dj.choices.ChoicesEntry.__str__()` to return `id`, which
gives the expected result when serialising and deserialising. This changes the API slightly, which requires a test update.