      def build_nested_field(self, field_name, info, model, nested_depth):
          """
          Create nested fields for forward and reverse relationships.
          """
          relation_info = info.relations[field_name]
  
          class NestedSerializer(ModelSerializer):
              class Meta:
                  model = relation_info.related
                  depth = nested_depth - 1
  
 
</s> remove                 model = relation_info.related
                depth = nested_depth - 1
 </s> add                 model = relation_info.related_model
                depth = nested_depth </s> remove                 model = relation_info.related
 </s> add                 model = relation_info.related_model </s> remove     def build_nested_field(self, field_name, info, model, nested_depth):
 </s> add     def build_nested_field(self, field_name, relation_info, nested_depth): </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         return field_cls, kwargs
 </s> add         return field_class, field_kwargs
      def build_nested_field(self, field_name, info, model, nested_depth):
          """
          Create nested fields for forward and reverse relationships.
          """


          class NestedSerializer(ModelSerializer):
              class Meta:
                  model = relation_info.related
                  depth = nested_depth - 1
  
keep keep keep keep replace replace keep keep keep keep keep
 Final bits of docs for ModelSerializer fields API 
rest_framework/serializers.py