def getProducts(request):
products = Product.objects.all()
p = Product.objects.all().filter(category = 1)
serializer = ProductSerializer((products,p), many=True)
return Response(serializer.data)**
I want to pass p and products value in the serializer object. Can I do this here?
product_qs = products | pthen do this:serializer = ProductSerializer(product_qs, many=True)