              model_field=None,
              related_model=related,
              to_many=relation.field.rel.multiple,
              has_through_model=False
          )
  
      # Deal with reverse many-to-many relationships.
      for relation in opts.get_all_related_many_to_many_objects():
 
</s>
            to_field=_get_to_field(relation.field),
              model_field=None,
              related_model=related,
              to_many=relation.field.rel.multiple,
            to_field=_get_to_field(relation.field),
              has_through_model=False
          )
  
      # Deal with reverse many-to-many relationships.
      for relation in opts.get_all_related_many_to_many_objects():
keep keep add keep keep keep keep keep
 Added support for the to_field on ForeignKey fields
rest_framework/utils/model_meta.py