              class Meta:
                  model = model_field.rel.to
          return NestedModelSerializer()
  
      def get_related_field(self, model_field, to_many=False):
          """
          Creates a default instance of a flat relational field.
          """
          # TODO: filter queryset using:
          # .using(db).complex_filter(self.rel.limit_choices_to)
 
</s> remove                 model = model_field.rel.to
 </s> add                 model = model_class </s> remove             'required': not(model_field.null or model_field.blank),
            'queryset': model_field.rel.to._default_manager,
 </s> add             'required': required,
            'queryset': model_class._default_manager, </s> remove     def get_nested_field(self, model_field):
 </s> add     def get_nested_field(self, model_field, rel=None):
    def get_related_field(self, model_field, rel=None, to_many=False):
              class Meta:
                  model = model_field.rel.to
          return NestedModelSerializer()
  
    def get_related_field(self, model_field, rel=None, to_many=False):
          """
          Creates a default instance of a flat relational field.
          """
          # TODO: filter queryset using:
          # .using(db).complex_filter(self.rel.limit_choices_to)
keep keep keep keep replace keep keep keep keep keep
 First pass on automatically including reverse relationship 
rest_framework/serializers.py