Here is my viewset that I am using

class ModuleViewSet(mixins.CreateModelMixin,
                    mixins.RetrieveModelMixin,
                    mixins.UpdateModelMixin,
                    mixins.ListModelMixin,
                    viewsets.GenericViewSet):
    queryset = models.Module.objects.all()
    permission_classes = [ModuleViewPermission]
    serializer_class = serializers.ModuleSerializer

I have turned the django.db logger logging to 'DEBUG' level and in the logs 
I can see that the queryset is being calculated for each request.
Am I doing something wrong. In documentation it is mentioned, that queryset 
is cached for subsequent requests. I can see the below log in each request 
logs

2020-07-26 13:52:45,281 DEBUG utils:110 26e61c0ac9c740d5bc8779428c5e51e1 
(0.006) SELECT "courses_module"."id", "courses_module"."course_id", 
"courses_module"."name", "courses_module"."number" FROM "courses_module"; 
args=() django.db.backends

Thanks
Aniket

-- 
You received this message because you are subscribed to the Google Groups 
"Django REST framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-rest-framework+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-rest-framework/2c2fbd93-9d5b-4934-9587-109998fcad0do%40googlegroups.com.

Reply via email to