title: How can you omit empty django-filter params in url?
body: <p>I am using django-filters to filter my queryset, I am wondering whether it is possible for the library to omit empty fields when generating a filtered URl.
  My URl would look like this:</p>
  <pre><code>/?price=&amp;producer=&amp;price__gte=4&amp;price__lte=&amp;producer__name=&amp;category__name=&amp;o=-price
  </code></pre>
  <p>And I want to achieve a cleaner one, using only non-empty filters:</p>
  <pre><code>/?price__gte=4&amp;o=-price
  </code></pre>
  <p>filters.py</p>
  <pre><code>class ProductFilter(django_filters.FilterSet):
      # price = django_filters.NumberFilter()
      price__gte = django_filters.NumberFilter(field_name=&quot;price&quot;, lookup_expr=&quot;gte&quot;)
      price__lte = django_filters.NumberFilter(field_name=&quot;price&quot;, lookup_expr=&quot;lte&quot;)
  
      vendor__name = django_filters.CharFilter(lookup_expr=&quot;icontains&quot;)
      category__name = django_filters.CharFilter(lookup_expr=&quot;icontains&quot;)
  
      o = django_filters.OrderingFilter(
          # tuple-mapping retains order
          fields=((&quot;price&quot;, &quot;price&quot;),),
          # labels do not need to retain order
      )
  
      class Meta:
          model = Product
          fields = [&quot;price&quot;, &quot;category&quot;, &quot;vendor&quot;]
  </code></pre>
  <p>views.py</p>
  <pre><code>class ProductListView(LoginRequiredMixin, ListView):
      model = Product
  
      ordering = [&quot;-created_at&quot;]
  
      def get_ordering(self):
          ordering = self.request.GET.get(&quot;ordering&quot;, &quot;-created_at&quot;)
          return ordering
  
      def get_queryset(self, **kwargs):
          qs = Product.objects.exclude(status=&quot;HID&quot;).all()
          return qs
  
      def get_context_data(self, **kwargs):
          context = super().get_context_data(**kwargs)
          f = ProductFilter(self.request.GET, queryset=self.get_queryset())
          context[&quot;filter&quot;] = f
          return context
  </code></pre>