django/django — pull request #2539 by mfogel (2014-04-12 04:32:48+00:00)
Title: Add tests, improve docs for field subclass with choices

This commit adds tests of a Field subclass with the `Field.choices` attribute set and clarifies the docs on `Field.choices`.

The docs currently somewhat misleadingly suggest that the first element of a 'choice' should be the actual value stored in the DB. This isn't the current behavior, nor would it be good behavior as it would require clients of the Field class to know how the Field actually stores values in the database. For fields that store values differently on different databases - this would be a whole can of worms.

See https://github.com/mfogel/django-timezone-field/issues/7 for more backstory and confusion on this issue.