9.2. Dynamic filtered content
def store(request, category_name = None):
products = Product.objects.filter(active=True) #? grabbing all products from the database (queryset, result of the search of the database)
if category_name:
products = products.filter(category__name = category_name) #? gets the name atribute from the category class and filters it according to the name of the category obtained from the banner

Last updated