diff --git a/products/views.py b/products/views.py index 33e5266..0037ab3 100644 --- a/products/views.py +++ b/products/views.py @@ -218,8 +218,8 @@ def product_search(request): products_qs = products_qs.filter(price__lte=price_max) # get min_price and max_price - prices['min'] = products_qs.aggregate(Min('price')) - prices['max'] = products_qs.aggregate(Max('price')) + prices['min'] = products_qs.aggregate(Min('price'))['price__min'] + prices['max'] = products_qs.aggregate(Max('price'))['price__max'] # serialize and list data serializer = ProductSerializer(products_qs, many=True) result_list = [dict(i) for i in serializer.data]