          relation_info = info.relations[field_name]
  
          class NestedSerializer(ModelSerializer):
              class Meta:
                  model = relation_info.related
                  depth = nested_depth - 1
  
          field_cls = NestedSerializer
          kwargs = get_nested_relation_kwargs(relation_info)
  
          return field_cls, kwargs
 
</s> remove                 model = relation_info.related
 </s> add                 model = relation_info.related_model </s> remove         field_cls = NestedSerializer
        kwargs = get_nested_relation_kwargs(relation_info)
 </s> add         field_class = NestedSerializer
        field_kwargs = get_nested_relation_kwargs(relation_info) </s> remove         relation_info = info.relations[field_name]

 </s> add  </s> remove         return field_cls, kwargs
 </s> add         return field_class, field_kwargs </s> remove         relation_info = info.relations[field_name]

        field_cls = self.serializer_related_class
        kwargs = get_relation_kwargs(field_name, relation_info)
 </s> add         field_class = self.serializer_related_class
        field_kwargs = get_relation_kwargs(field_name, relation_info)
                model = relation_info.related_model
                depth = nested_depth
          relation_info = info.relations[field_name]
  
          class NestedSerializer(ModelSerializer):
              class Meta:
                model = relation_info.related_model
                depth = nested_depth
                model = relation_info.related_model
                depth = nested_depth
  
          field_cls = NestedSerializer
          kwargs = get_nested_relation_kwargs(relation_info)
  
          return field_cls, kwargs
keep keep keep keep replace replace keep keep keep keep keep
 Final bits of docs for ModelSerializer fields API 
rest_framework/serializers.py