diff --git a/accounts/api/views.py b/accounts/api/views.py index a179c85..55f5d78 100644 --- a/accounts/api/views.py +++ b/accounts/api/views.py @@ -35,7 +35,7 @@ class UserAuthenticatedFollowingsAPIView(ListAPIView): """ Authenticated User can see own followings and unfollow them. """ - queryset = Relation.objects.all() + queryset = Relation.objects.select_related('to_user').all() permission_classes = [IsAuthenticated] serializer_class = UserFollowingsSerializer @@ -70,7 +70,7 @@ class UserAuthenticatedFollowersAPIView(ListAPIView): """ Authenticated User can see own followers """ - queryset = Relation.objects.all() + queryset = Relation.objects.select_related('from_user').all() permission_classes = [IsAuthenticated] serializer_class = UserFollowersSerializer diff --git a/jobs/api/views.py b/jobs/api/views.py index 27f3fb7..6b454a2 100644 --- a/jobs/api/views.py +++ b/jobs/api/views.py @@ -26,7 +26,7 @@ class UserSkillProjectViewSet(ListModelMixin, GenericViewSet): """ To show all projects by authenticated User skills """ - queryset = Project.objects.all() + queryset = Project.objects.prefetch_related('skills__skill').all() serializer_class = ProjectSerializer pagination_class = StandardSizePagination permission_classes = [IsAuthenticated]