          """
          # TODO: filter queryset using:
          # .using(db).complex_filter(self.rel.limit_choices_to)
          kwargs = {
              'required': not(model_field.null or model_field.blank),
              'queryset': model_field.rel.to._default_manager,
              'many': to_many
          }
  
          return PrimaryKeyRelatedField(**kwargs)
  
 
</s> remove     def get_related_field(self, model_field, to_many=False):
 </s> add     def get_related_field(self, model_field, rel=None, to_many=False): </s> remove         return None
 </s> add         if self.opts.fields and model_field.name in self.opts.fields:
            return self.get_field(model_field) </s> remove                 model = model_field.rel.to
 </s> add                 model = model_class
            'required': required,
            'queryset': model_class._default_manager,
          """
          # TODO: filter queryset using:
          # .using(db).complex_filter(self.rel.limit_choices_to)
          kwargs = {
            'required': required,
            'queryset': model_class._default_manager,
            'required': required,
            'queryset': model_class._default_manager,
              'many': to_many
          }
  
          return PrimaryKeyRelatedField(**kwargs)
  
keep keep keep keep replace replace keep keep keep keep keep
 First pass on automatically including reverse relationship 
rest_framework/serializers.py