Allow ChoiceField and friends to take a callable for choices kwarg
|Reported by:||Jeremy Dunck||Owned by:||nobody|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
Sometimes we'd like choices to be dynamic (often the result of an ORM query), but because models are declarative, this forces queries to run with Django partially loaded.
It would be good to be able to make choices a callable so that these queries could be deferred until Django is fully loaded.
I'm attaching a rough patch; if this passes design-decision, I can polish it up with tests.