I am having difficulty getting the URL (or any sort of ID) back from the `validated_data` when using a `HyperlinkedIdentityField`. I need the URL because I am doing writable nested representations and I want to know if the nested representation refers to an existing object (url specified) or a new object (url not specified). I have read the [example](http://www.django-rest-framework.org/api-guide/serializers/#customizing-multiple-update) in the docs about customizing `ListSerializer` update but that seems to rely on the client sending an `id` that does not exist, which does not work for me as I want to use URLs instead. I have checked `validated_data` for a top-level (not nested) object with a `HyperlinkedIdentityField` and the ID is not exposed there either. 

**EDIT**: I am now aware this is because `HyperlinkedIdentityField` sets the `read_only` attribute and read-only fields are skipped when generating validated data. Tips welcome on how to get around this.

I have two models in this phonebook app: `Entry` and `Phone`. An `Entry` has multiple `Phone`s. Just in case this is relevant, the model code is as follows:

```
from django.db import models

class Entry(models.Model):
    name = models.CharField(max_length=200)

class Phone(models.Model):
    type = models.CharField(max_length=20)
    number = models.CharField(max_length=50)
    parent = models.ForeignKey(Entry, related_name='phones')

```

My serializer definitions follow:

```
class PhoneListSerializer(serializers.ListSerializer):
    def update(self, instance, validated_data): 
        print repr(validated_data)
        url_of = lambda p : self.child.to_representation(p)['url']
        existing_instances = { url_of(p): p for p in instance }
        existing_submitted_instances = { item['url']: item for item in validated_data if 'url' in item }
        new_submitted_instances = [ item for item in validated_data if 'url' not in item ]
        urls_to_delete = existing_instances.viewkeys() - existing_submitted_instances.viewkeys()                                                       
        objects_to_delete = [existing_instances[u] for u in urls_to_delete if u in existing_instances]                                                 
        objects_to_update = [(existing_instances[u], p) for u, p in six.iteritems(existing_submitted_instances) if u in existing_instances]

        result = []
        for o in objects_to_delete:
            o.delete()
        for existing, data in objects_to_update:                          
            result.append(self.child.update(existing, data))
        for data in new_submitted_instances:                              
            data['parent'] = self.root.instance
            result.append(self.child.create(data))
        return result

class PhoneSerializer(serializers.HyperlinkedModelSerializer):
    url = serializers.HyperlinkedIdentityField(
        view_name='phone', lookup_field='id')
    class Meta:
        model = Phone
        list_serializer_class = PhoneListSerializer
        fields = ('type', 'number', 'url')

class EntrySerializer(serializers.HyperlinkedModelSerializer):
    url = serializers.HyperlinkedIdentityField(
        view_name='entry', lookup_field='id')
    phones = PhoneSerializer(many=True, required=False)

    class Meta:
        model = Entry
        fields = ('url', 'name', 'phones')

    def update(self, instance, validated_data):
        print repr(validated_data)
        # pop this first so super does not complain about writable nested
        # serializers. we will update phones ourselves.
        phone_data = validated_data.pop('phones', [])
        phones_field = self.fields['phones']

        instance = super(EntrySerializer, self).update(instance, validated_data)

        phones_field.update(instance.phones.all(), phone_data)

        return instance

    def create(self, validated_data):
        phone_data = validated_data.pop('phones', [])
        new_entry = Entry.objects.create(**validated_data)
        # TODO atomically do this
        for phone_validated_data in phone_data:
            Phone.objects.create(parent=new_entry, **phone_validated_data)
        return new_entry

```

Currently getting data out works, but resubmitting the data (even with the URL) results in all phones of an entry being deleted and then recreated with new IDs.

**EDIT**: attempting to use a `HyperlinkedRelatedField` (and a `ModelSerializer` instead of a `HyperlinkedModelSerializer`) gets further (the field succeeds in pulling an object out), but still fails when the serializer calls `fields.set_value`

Code: 

```
class PhoneSerializer(serializers.ModelSerializer):
    url = serializers.HyperlinkedRelatedField(
        required=False, view_name='phone', lookup_field='id',
        queryset=Phone.objects, source='*')

```

This fails since it eventually calls `rest_framework.fields.set_value(validated_data, [], <Phone object>)` and it will call `validated_data.update(<Phone object>)` which fails with 'Phone object is not iterable'.

```
Traceback (most recent call last):
  [...snip...]
  File "/app/phonebook_be/views.py", line 41, in entry
    if serializer.is_valid(raise_exception=True):
  File "/venv/lib/python2.7/site-packages/rest_framework/serializers.py", line 191, in is_valid
    self._validated_data = self.run_validation(self.initial_data)
  File "/venv/lib/python2.7/site-packages/rest_framework/serializers.py", line 371, in run_validation
    value = self.to_internal_value(data)
  File "/venv/lib/python2.7/site-packages/rest_framework/serializers.py", line 404, in to_internal_value
    validated_value = field.run_validation(primitive_value)
  File "/venv/lib/python2.7/site-packages/rest_framework/serializers.py", line 522, in run_validation
    value = self.to_internal_value(data)
  File "/venv/lib/python2.7/site-packages/rest_framework/serializers.py", line 552, in to_internal_value
    validated = self.child.run_validation(item)
  File "/venv/lib/python2.7/site-packages/rest_framework/serializers.py", line 371, in run_validation
    value = self.to_internal_value(data)
  File "/venv/lib/python2.7/site-packages/rest_framework/serializers.py", line 414, in to_internal_value
    set_value(ret, field.source_attrs, validated_value)
  File "/venv/lib/python2.7/site-packages/rest_framework/fields.py", line 96, in set_value
    dictionary.update(value)
  File "/venv/lib/python2.7/_abcoll.py", line 568, in update
    for key, value in other:
TypeError: 'Phone' object is not iterable

```

Other attempts:

`source='id'`: results in error when rendering

```
Traceback (most recent call last):
  [...snip...]
  File "/app/phonebook_be/views.py", line 18, in entries
    json_data = JSONRenderer().render(serializer.data)
  File "/venv/lib/python2.7/site-packages/rest_framework/serializers.py", line 470, in data
    ret = super(Serializer, self).data
  File "/venv/lib/python2.7/site-packages/rest_framework/serializers.py", line 217, in data
    self._data = self.to_representation(self.instance)
  File "/venv/lib/python2.7/site-packages/rest_framework/serializers.py", line 439, in to_representation
    ret[field.field_name] = field.to_representation(attribute)
  File "/venv/lib/python2.7/site-packages/rest_framework/serializers.py", line 572, in to_representation
    self.child.to_representation(item) for item in iterable
  File "/venv/lib/python2.7/site-packages/rest_framework/serializers.py", line 439, in to_representation
    ret[field.field_name] = field.to_representation(attribute)
  File "/venv/lib/python2.7/site-packages/rest_framework/relations.py", line 264, in to_representation
    return self.get_url(value, self.view_name, request, format)
  File "/venv/lib/python2.7/site-packages/rest_framework/relations.py", line 202, in get_url
    lookup_value = getattr(obj, self.lookup_field)
AttributeError: 'int' object has no attribute 'id'

```