      if to_many:
          kwargs['many'] = True
  
      if has_through_model:
          kwargs['read_only'] = True
          kwargs.pop('queryset', None)
  
 
</s> remove     model_field, related_model, to_many, has_through_model = relation_info
 </s> add     model_field, related_model, to_many, to_field, has_through_model = relation_info
    if to_field:
        kwargs['to_field'] = to_field

      if to_many:
          kwargs['many'] = True
  
    if to_field:
        kwargs['to_field'] = to_field

      if has_through_model:
          kwargs['read_only'] = True
          kwargs.pop('queryset', None)
  
keep keep add keep keep keep keep
 Added support for the to_field on ForeignKey fields 
rest_framework/utils/field_mapping.py