1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

[1.11.x] Fixed #28345 -- Applied limit_choices_to during ModelForm.__init__().

field_for_model() now has an additional keyword argument,
apply_limit_choices_to, allowing it to continue to be used to create
form fields dynamically after ModelForm.__init__() is called.

Thanks Tim Graham for the review.

Backport of a1be12fe19 from master
This commit is contained in:
Jon Dufresne
2017-06-28 20:30:19 -07:00
committed by Tim Graham
parent c1621d8008
commit 8641489f4d
3 changed files with 37 additions and 12 deletions

View File

@@ -57,3 +57,6 @@ Bugfixes
* Fixed ``UnboundLocalError`` crash in ``RenameField`` with nonexistent field
(:ticket:`28350`).
* Fixed a regression preventing a model field's ``limit_choices_to`` from being
evaluated when a ``ModelForm`` is instantiated (:ticket:`28345`).