django-admin-autocomplete-filter icon indicating copy to clipboard operation
django-admin-autocomplete-filter copied to clipboard

Fix autocomplete not working with related model

Open KessoumML opened this issue 3 years ago • 1 comments

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

KessoumML avatar Feb 25 '22 11:02 KessoumML

I need this !!!

tsotnesharvadze avatar Jun 29 '22 11:06 tsotnesharvadze