          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:
 
</s> remove             obj = obj.serializable_value(self.source or field_name)
 </s> add             pk = obj.serializable_value(self.source or field_name) </s> remove             obj = obj.serializable_value(self.source or field_name)
 </s> add             queryset = obj.serializable_value(self.source or field_name) </s> remove         return self.to_native(obj)
 </s> add         return self.to_native(pk) </s> remove         return [self.to_native(item.pk) for item in obj.all()]
 </s> add         return [self.to_native(item.pk) for item in queryset.all()]
            queryset = getattr(obj, self.source or field_name)
            return [self.to_native(item.pk) for item in queryset.all()]
          try:
              obj = obj.serializable_value(self.source or field_name)
          except AttributeError:
              # RelatedManager (reverse relationship)
            queryset = getattr(obj, self.source or field_name)
            return [self.to_native(item.pk) for item in queryset.all()]
            queryset = getattr(obj, self.source or field_name)
            return [self.to_native(item.pk) for item in queryset.all()]
          # Forward relationship
          return [self.to_native(item.pk) for item in obj.all()]
  
      def field_from_native(self, data, field_name, into):
          try:
keep keep keep keep replace replace keep keep keep keep keep
 Use either PrimaryKeyRelatedField or ManyPrimaryKeyRelatedField as appropriate (fixes test) 
rest_framework/fields.py