      # Deal with forward many-to-many relationships.
      for field in [field for field in opts.many_to_many if field.serialize]:
          forward_relations[field.name] = RelationInfo(
              model_field=field,
              related=_resolve_model(field.rel.to),
              to_many=True,
              has_through_model=(
                  not field.rel.through._meta.auto_created
              )
          )
 
</s> remove             related=relation.model,
 </s> add             related_model=relation.model, </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) </s> remove             # Populate any kwargs defined in `Meta.extra_kwargs`
            kwargs = self.build_field_kwargs(kwargs, extra_kwargs, field_name)
 </s> add             # Include any kwargs defined in `Meta.extra_kwargs`
            field_kwargs = self.build_field_kwargs(
                field_kwargs, extra_kwargs, field_name
            ) </s> remove         # Now determine the fields that should be included on the serializer.
        ret = OrderedDict()
 </s> add         # Determine the fields that should be included on the serializer.
        fields = OrderedDict()

            related_model=_resolve_model(field.rel.to),
      # Deal with forward many-to-many relationships.
      for field in [field for field in opts.many_to_many if field.serialize]:
          forward_relations[field.name] = RelationInfo(
              model_field=field,
            related_model=_resolve_model(field.rel.to),
              to_many=True,
              has_through_model=(
                  not field.rel.through._meta.auto_created
              )
          )
keep keep keep keep replace keep keep keep keep keep
 Final bits of docs for ModelSerializer fields API 
rest_framework/utils/model_meta.py