I have an issue with the django-filter application: how to hide the items that will produce zero results. I think that there is a simple method to do this, but idk how.
I'm using the LinkWidget on a ModelChoiceFilter, like this:
provider = django_filters.ModelChoiceFilter(queryset=Provider.objects.all(),
widget=django_filters.widgets.LinkWidget)
What I need to do is filter the queryset and select only the Provider that will produce at least one result, and exclude the others. There is a way to do that?