      model = None
      serializer_class = None
      model_serializer_class = api_settings.DEFAULT_MODEL_SERIALIZER_CLASS
  
      def get_serializer_context(self):
          """
          Extra context provided to the serializer class.
 
</s> remove         self.object = self.get_object()
 </s> add         queryset = self.get_queryset()
        filtered_queryset = self.filter_queryset(queryset)
        self.object = self.get_object(filtered_queryset) </s> remove     filter_backend = api_settings.FILTER_BACKEND

    def filter_queryset(self, queryset):
        """
        Given a queryset, filter it with whichever filter backend is in use.
        """
        if not self.filter_backend:
            return queryset
        backend = self.filter_backend()
        return backend.filter_queryset(self.request, queryset, self)
 </s> add 
    filter_backend = api_settings.FILTER_BACKEND

    def filter_queryset(self, queryset):
        """
        Given a queryset, filter it with whichever filter backend is in use.
        """
        if not self.filter_backend:
            return queryset
        backend = self.filter_backend()
        return backend.filter_queryset(self.request, queryset, self)
      model = None
      serializer_class = None
      model_serializer_class = api_settings.DEFAULT_MODEL_SERIALIZER_CLASS
    filter_backend = api_settings.FILTER_BACKEND

    def filter_queryset(self, queryset):
        """
        Given a queryset, filter it with whichever filter backend is in use.
        """
        if not self.filter_backend:
            return queryset
        backend = self.filter_backend()
        return backend.filter_queryset(self.request, queryset, self)
  
      def get_serializer_context(self):
          """
          Extra context provided to the serializer class.
keep keep add keep keep keep keep
 GenericAPIView now applies filter_backend for list and retrieve api views

Before this commit only the MultipleObjectAPIView would apply a
filter_backend, leaving the SingleObjectAPIView to return objects you
might otherwise expect to have been filtered out.

It's worth mentioning that when a SingleObjectAPIView makes a request
for an object that should be excluded, a 404 is the expected result. 
rest_framework/generics.py