django-admin-autocomplete-filter
django-admin-autocomplete-filter copied to clipboard
Custom search viewset doesn't work in Django >= 3.2
When i try to create custom view as its documented in README, i gets following error:
AttributeError: 'CustomSearchView' object has no attribute 'source_field'
and the search field shows nothing
I got around this by adding source_field as an attribute on my CustomSearchView, and I just passed the name of the fk field. I added that to as_view call so that looks like CustomSearchView.as_view(model_admin=self, source_field='fk_field')
That almost worked and the last change was just that rather than ever using super.get_queryset() I wrote custom logic for filtering the get_queryset method