              obj = obj.serializable_value(self.source or field_name)
          except AttributeError:
              field = obj._meta.get_field_by_name(field_name)[0]
              obj = getattr(obj, self.source or field_name)
              if obj.__class__.__name__ == 'RelatedManager':
                  return [self.to_native(item.pk) for item in obj.all()]
              elif isinstance(field, RelatedObject):
                  return self.to_native(obj.pk)
              raise
          if obj.__class__.__name__ == 'ManyRelatedManager':
              return [self.to_native(item.pk) for item in obj.all()]
          return self.to_native(obj)
  
      def field_from_native(self, data, field_name, into):
          value = data.get(field_name)
          if hasattr(value, '__iter__'):
 
</s> remove         if hasattr(value, '__iter__'):
            into[field_name] = [self.from_native(item) for item in value]
        else:
            into[field_name + '_id'] = self.from_native(value)
 </s> add         into[field_name + '_id'] = self.from_native(value)


class ManyPrimaryKeyRelatedField(PrimaryKeyRelatedField):
    def field_to_native(self, obj, field_name):
        try:
            obj = obj.serializable_value(self.source or field_name)
        except AttributeError:
            # RelatedManager (reverse relationship)
            obj = getattr(obj, self.source or field_name)
            return [self.to_native(item.pk) for item in obj.all()]
        # Forward relationship
        return [self.to_native(item.pk) for item in obj.all()]

    def field_from_native(self, data, field_name, into):
        try:
            value = data.getlist(field_name)
        except:
            value = data.get(field_name)
        into[field_name] = [self.from_native(item) for item in value] </s> remove             field = obj._meta.get_field_by_name(field_name)[0]
 </s> add             # RelatedObject (reverse relationship)
            return self.to_native(obj.pk)
        # Forward relationship
              obj = obj.serializable_value(self.source or field_name)
          except AttributeError:
              field = obj._meta.get_field_by_name(field_name)[0]
              obj = getattr(obj, self.source or field_name)
            return self.to_native(obj.pk)
        # Forward relationship
            return self.to_native(obj.pk)
        # Forward relationship
            return self.to_native(obj.pk)
        # Forward relationship
            return self.to_native(obj.pk)
        # Forward relationship
            return self.to_native(obj.pk)
        # Forward relationship
            return self.to_native(obj.pk)
        # Forward relationship
            return self.to_native(obj.pk)
        # Forward relationship
          return self.to_native(obj)
  
      def field_from_native(self, data, field_name, into):
          value = data.get(field_name)
          if hasattr(value, '__iter__'):
keep keep keep keep replace replace replace replace replace replace replace keep keep keep keep keep
 Split out PrimaryKeyRelatedField and ManyPrimaryKeyRelatedField 
rest_framework/fields.py