|
|
|
@ -97,7 +97,7 @@ class CategoryView(CategoryBaseView, TemplateView): |
|
|
|
q = self.request.GET.get('q', '') |
|
|
|
q = self.request.GET.get('q', '') |
|
|
|
self.products_qs = Product.objects.filter(title__icontains=q).order_by('-pk') |
|
|
|
self.products_qs = Product.objects.filter(title__icontains=q).order_by('-pk') |
|
|
|
retval['brands'] = list(set(map(lambda item: item.brand, self.products_qs))) |
|
|
|
retval['brands'] = list(set(map(lambda item: item.brand, self.products_qs))) |
|
|
|
if self.is_sale: |
|
|
|
elif self.is_sale: |
|
|
|
self.products_qs = Product.objects.filter(variations__discount__gt=0).distinct().order_by('-pk') |
|
|
|
self.products_qs = Product.objects.filter(variations__discount__gt=0).distinct().order_by('-pk') |
|
|
|
retval['brands'] = list(set(map(lambda item: item.brand, self.products_qs))) |
|
|
|
retval['brands'] = list(set(map(lambda item: item.brand, self.products_qs))) |
|
|
|
else: |
|
|
|
else: |
|
|
|
|