title: Django Rest Framework - Read nested data, write integer
body: <p>So far I'm extremely happy with Django Rest Framework, which is why I alsmost can't believe there's such a large omission in the codebase. Hopefully someone knows of a way how to support this:</p>
  
  <pre><code>class PinSerializer(serializers.ModelSerializer):
      item = ItemSerializer(read_only=True, source='item')
      item = serializers.IntegerSerializer(write_only=True)
  
      class Meta:
          model = Pin
  </code></pre>
  
  <p>with the goal</p>
  
  <pre><code>The goal here is to read:
  {pin: item: {name: 'a', url: 'b'}}
  but to write using an id
  {pin: item: 10}
  </code></pre>
  
  <p>An alternative would be to use two serializers, but that looks like a really ugly solution:
  <a href="https://stackoverflow.com/questions/17769814/django-rest-framework-model-serializers-read-nested-write-flat">django rest framework model serializers - read nested, write flat</a></p>