class NestedViewSetMixin(object):
    def get_queryset(self):
        """
        Filter the `QuerySet` based on its parents as defined in the
        `serializer_class.parent_lookup_kwargs`.
        """
        queryset = super(NestedViewSetMixin, self).get_queryset()
        if hasattr(self.serializer_class, 'parent_lookup_kwargs'):
            orm_filters = {}
            for query_param, field_name in self.serializer_class.parent_lookup_kwargs.items():
                orm_filters[field_name] = self.kwargs[query_param]
            return queryset.filter(**orm_filters)
        return queryset

class NestedViewSetMixin(object):
    def get_queryset(self):
        """
        Filter the `QuerySet` based on its parents as defined in the
        `serializer_class.parent_lookup_kwargs`.
        """
        queryset = super(NestedViewSetMixin, self).get_queryset()
        serializer_class = self.get_serializer_class()
        if hasattr(serializer_class, 'parent_lookup_kwargs'):
            orm_filters = {}
            for query_param, field_name in serializer_class.parent_lookup_kwargs.items():
                orm_filters[field_name] = self.kwargs[query_param]
            return queryset.filter(**orm_filters)
        return queryset

Fix to use get_serializer_class method instead of serializer_class
Fix to use get_serializer_class method instead of serializer_class

  class NestedViewSetMixin(object):
      def get_queryset(self):
          """
          Filter the `QuerySet` based on its parents as defined in the
          `serializer_class.parent_lookup_kwargs`.
          """
          queryset = super(NestedViewSetMixin, self).get_queryset()
+         serializer_class = self.get_serializer_class()
-         if hasattr(self.serializer_class, 'parent_lookup_kwargs'):
+         if hasattr(serializer_class, 'parent_lookup_kwargs'):
              orm_filters = {}
-             for query_param, field_name in self.serializer_class.parent_lookup_kwargs.items():
+             for query_param, field_name in serializer_class.parent_lookup_kwargs.items():
                  orm_filters[field_name] = self.kwargs[query_param]
              return queryset.filter(**orm_filters)
          return queryset
  
Fix to use get_serializer_class method instead of serializer_class
## Code Before:
class NestedViewSetMixin(object):
    def get_queryset(self):
        """
        Filter the `QuerySet` based on its parents as defined in the
        `serializer_class.parent_lookup_kwargs`.
        """
        queryset = super(NestedViewSetMixin, self).get_queryset()
        if hasattr(self.serializer_class, 'parent_lookup_kwargs'):
            orm_filters = {}
            for query_param, field_name in self.serializer_class.parent_lookup_kwargs.items():
                orm_filters[field_name] = self.kwargs[query_param]
            return queryset.filter(**orm_filters)
        return queryset

## Instruction:
Fix to use get_serializer_class method instead of serializer_class
## Code After:
class NestedViewSetMixin(object):
    def get_queryset(self):
        """
        Filter the `QuerySet` based on its parents as defined in the
        `serializer_class.parent_lookup_kwargs`.
        """
        queryset = super(NestedViewSetMixin, self).get_queryset()
        serializer_class = self.get_serializer_class()
        if hasattr(serializer_class, 'parent_lookup_kwargs'):
            orm_filters = {}
            for query_param, field_name in serializer_class.parent_lookup_kwargs.items():
                orm_filters[field_name] = self.kwargs[query_param]
            return queryset.filter(**orm_filters)
        return queryset
