45👍
✅
This:
products = Product.objects.filter(category=category, subcategory=subcategory, kind=kind, available=True)
Should be either:
products = Product.objects.filter(category=category, subcategory=subcategory, kind=kind[0], available=True)
if you want to filter based on one kind,
Or:
products = Product.objects.filter(category=category, subcategory=subcategory, kind__in=kind, available=True)
if you want to filter Products
on all kind
objects returned above.
👤Alex
Source:stackexchange.com