title: djangorestframework: Filtering in a related field
body: <p>Basically, I want to filter out inactive users from a related field of a ModelSerializer. I tried <a href="https://stackoverflow.com/questions/15328632/dynamically-limiting-queryset-of-related-field">Dynamically limiting queryset of related field</a> as well as the following:</p>
  
  <pre><code>class MySerializer(serializers.ModelSerializer):
    users = serializers.PrimaryKeyRelatedField(queryset=User.objects.filter(active=True), many=True)
    class Meta:
      model = MyModel
      fields = ('users',)
  </code></pre>
  
  <p>Neither of these approaches worked for just filtering the queryset. I want to do this for a nested related Serializer class as a field (but couldn't even get it to work with a RelatedField).</p>
  
  <p>How do I filter queryset for nested relation?</p>