title: DRF: Simple foreign key assignment with nested serializers?
body: <p>With Django REST Framework, a standard ModelSerializer will allow ForeignKey model relationships to be assigned or changed by POSTing an ID as an Integer.</p>
  
  <p>What's the <em>simplest</em> way to get this behavior out of a nested serializer?</p>
  
  <p>Note, I am only talking about assigning existing database objects, <em>not</em> nested creation.</p>
  
  <p>I have hacked away around this in the past with additional 'id' fields in the serializer and with custom <code>create</code> and <code>update</code> methods, but this is such a seemingly simple and frequent issue for me that I'm curious to know the best way.</p>
  
  <pre class="lang-py prettyprint-override"><code>class Child(models.Model):
      name = CharField(max_length=20)
  
  class Parent(models.Model):
      name = CharField(max_length=20)
      phone_number = models.ForeignKey(PhoneNumber)
      child = models.ForeignKey(Child)
  
  class ChildSerializer(ModelSerializer):
      class Meta:
          model = Child
  
  class ParentSerializer(ModelSerializer):
      # phone_number relation is automatic and will accept ID integers
      children = ChildSerializer() # this one will not
  
      class Meta:
          model = Parent
  </code></pre>