get_descendats categories in search_products

This commit is contained in:
Diego Calvo
2021-03-19 14:31:59 +01:00
parent 815a55f45c
commit 79393320c1

View File

@@ -188,7 +188,7 @@ def product_search(request):
cat = CategoryTag.objects.filter(label__iexact=entry).first() cat = CategoryTag.objects.filter(label__iexact=entry).first()
# append category tag, and children # append category tag, and children
descendants.append(cat) descendants.append(cat)
descendants.extend(cat.children.all()) descendants.extend(cat.get_descendants())
products_qs = products_qs.filter(category__in=descendants) products_qs = products_qs.filter(category__in=descendants)
# filter by tags # filter by tags