class ProductListView(ListView):
model = Product
def get_queryset(self):
qs = super().get_queryset()
get_params = self.request.GET.dict()
# search
if get_params.get('q'):
qs = qs.filter(product_title__icontains=get_params.get('q'))