title: How do you filter a nested serializer in Django Rest Framework?
body: <p>In Django Rest Framework, how do you filter a serializer when it's nested in another serializer?</p>
  
  <p>My filters are imposed in the DRF viewsets, but when you call a serializer from inside another serializer, the viewset of the nested serializer never gets called, so the nested results appear unfiltered.</p>
  
  <p>I have tried adding a filter on originating viewset, but it doesn't seem to filter the nested results because the nested results get called as a separate pre-fretched query. (The nested serializer is a reverse lookup, you see.)</p>
  
  <p>Is it possible to add a get_queryset() override in the nested serializer itself (moving it out of the viewset), to add the filter there? I've tried that, too, with no luck.</p>
  
  <p>This is what I tried, but it doesn't even seem to get called:</p>
  
  <pre><code>class QuestionnaireSerializer(serializers.ModelSerializer):
      edition = EditionSerializer(read_only=True)
      company = serializers.StringRelatedField(read_only=True)
  
      class Meta:
          model = Questionnaire
  
      def get_queryset(self):
          query = super(QuestionnaireSerializer, self).get_queryset(instance)
          if not self.request.user.is_staff:
              query = query.filter(user=self.request.user, edition__hide=False)
          return query
  </code></pre>