django/django — pull request #1600 by adamsc64 (2013-09-07 21:47:54+00:00)
Title: Fixed #2445 -- ``limit_choices_to`` attribute can now be a callable.

- ForeignKey or ManyToManyField attribute ``limit_choices_to`` can now
be a callable that returns either a ``Q`` object or a dict.
- The callable will be invoked at ModelForm initialization time.
- Admin form behavior modified to handle new functionality.
- Admin widget behavior modified to handle new functionality.
- Updated Django documentation field reference section.
- Added unit tests for ``limit_choices_to`` on ModelForms.
- Tweaked unit tests for Admin to use some callables for
``limit_choices_to``.