I\'m using https://github.com/alex/django-filter
When user opens the page with filter at the first time, they see the empty form and full list of results.
I need
After some studies, I've found this simple solution
class ProductFilter(django_filters.FilterSet):
class Meta:
model = Product
fields = [ 'shortname', 'fullname', 'description', 'product_type', ]
def __init__(self, *args, **kwargs):
super(ProductFilter, self).__init__(*args, **kwargs)
# at sturtup user doen't push Submit button, and QueryDict (in data) is empty
if self.data == {}:
self.queryset = self.queryset.none()
I think, this solution is stable. How do you think?