django/django — pull request #2233 by adamsc64 (2014-02-03 04:56:56+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 test class using ``limit_choices_to`` on ModelForm.