mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
Fixed #2445 -- Allowed limit_choices_to attribute to be a callable.
ForeignKey or ManyToManyField attribute ``limit_choices_to`` can now be a callable that returns either a ``Q`` object or a dict. Thanks michael at actrix.gen.nz for the original suggestion.
This commit is contained in:
committed by
Tim Graham
parent
a718fcf201
commit
eefc88feef
@@ -608,6 +608,10 @@ Models
|
||||
* It is now possible to use ``None`` as a query value for the :lookup:`iexact`
|
||||
lookup.
|
||||
|
||||
* It is now possible to pass a callable as value for the attribute
|
||||
:attr:`ForeignKey.limit_choices_to` when defining a ``ForeignKey`` or
|
||||
``ManyToManyField``.
|
||||
|
||||
Signals
|
||||
^^^^^^^
|
||||
|
||||
|
||||
Reference in New Issue
Block a user