Fix many-to-many by finding related model from descriptor
In https://github.com/farhan0581/django-admin-autocomplete-filter/blob/master/admin_auto_filters/filters.py#L53 we attempt to call .get_queryset() on the descriptor of the field. For foreign keys this works fine, but for ManyToManyDescriptor (which is present if you're referencing a ManyToManyField), Django never defines get_queryset on the class or its superclass: https://github.com/django/django/blob/master/django/db/models/fields/related_descriptors.py#L748
This is kind of an oversight and broken-duck-typing on the Django team's part, and it's trivially and harmlessly monkey-patched by doing the following somewhere, which causes the filter to work as intended.
ManyToManyDescriptor.get_queryset = lambda self: self.rel.model.objects.get_queryset()
But the correct fix would be to fall back to a call like this in the filter code itself - this PR does exactly that!
Thanks buddy for your contribution. Please review your pull request once to resolve merge conflict and please raise the pull request to dev branch.
Will do once I look at @merwok's comment!
I think we may have addressed this, both in 0.6.1 and with additional changes in pre_release.