farhan0581 / django-admin-autocomplete-filter

A simple Django app to render list filters in django admin using autocomplete widget.
GNU General Public License v3.0
351 stars 75 forks source link

Fix autocomplete not working with related model #76

Open KessoumML opened 2 years ago

KessoumML commented 2 years ago

After the minor feature introduced in Django 3.2, the autocomplete does not work anymore with related model

ModelAdmin.autocomplete_fields now respects ForeignKey.to_field and ForeignKey.limit_choices_to when searching a related model.

The problem is that a related model does not have limit_choices_to attribute, which causes an error when filtering the queryset by limit_choices_to

The fix is related to #73

tsotnesharvadze commented 2 years ago

I need this !!!