Sobes.tech
Junior — Senior

Updating queryset considering the related level model

livecode

Task condition

It is necessary to uncomment the line defining the queryset and adapt it so that the related object level is taken into account during selection. Below is the original code fragment that should be corrected:

from api.serializers import CourseSerializer

class CourseViewSet(viewsets.ModelViewSet):
    serializer_class = CourseSerializer
    # queryset = Course.objects.all()
    permission_classes = (AllowAny,)

After completing the task, the request should return course objects along with their level.