Fixed #29010, Fixed #29138 -- Added limit_choices_to and to_field support to autocomplete fields.

* Fixed #29010 -- Added limit_choices_to support to autocomplete fields.
* Fixed #29138 -- Allowed autocomplete fields to target a custom
  to_field rather than the PK.
This commit is contained in:
Johannes Maron 2021-01-12 11:37:38 +01:00 committed by GitHub
parent ba3fb2e4d0
commit 3071660acf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 200 additions and 60 deletions

View file

@ -119,6 +119,12 @@ Minor features
* The admin now supports theming. See :ref:`admin-theming` for more details.
* :attr:`.ModelAdmin.autocomplete_fields` now respects
:attr:`ForeignKey.to_field <django.db.models.ForeignKey.to_field>` and
:attr:`ForeignKey.limit_choices_to
<django.db.models.ForeignKey.limit_choices_to>` when searching a related
model.
:mod:`django.contrib.admindocs`
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~