title: Django - serializer validation with foreign key
body: <p>I have two models to represent a Student and his Contact.</p>
  
  <pre><code>class Contact(models.Model):
    phone_num = models.IntegerField()
    email = models.TextField()
  
  class Student(models.Model):
    name = models.TextField()
    age = models.IntegerField()
    contact = models.ForeignKey(Contact)
  </code></pre>
  
  <p>The data structure that I needed to return with:</p>
  
  <pre><code>{
    name: 'Peter',
    age: 18,
    contact: {
      phone_num: 1234567890,
      email: 'peter123@gmail.com'
    }
  }
  </code></pre>
  
  <p>In my post request, I receive a json format data:</p>
  
  <pre><code>{
    name: 'Mary',
    age: 19,
    phone_num: 9876543210,
    email: mary987@gmail.com
  }
  </code></pre>
  
  <p>I'm trying to create a serializer for data validation.</p>
  
  <p>Contact:</p>
  
  <pre><code>class ContactSerializer(ModelSerializer):
    class Meta:
      model = Contact
      exclude = ('id',)
  </code></pre>
  
  <p>Student:</p>
  
  <pre><code>class StudentSerializer(ModelSerializer):
    contact = ContactSerializer()
  
    class Meta:
      model = Student
      exclude = ('id',)
  </code></pre>
  
  <p>I tried to put the post request data into the serializer and check if it's valid.</p>
  
  <pre><code>data = {
    name: 'Mary',
    age: 19,
    phone_num: 9876543210,
    email: mary987@gmail.com
  }
  student = StudentSerializer(data=data)
  student.is_valid()
  // It returns false.
  print(student.errors)
  // Print: {'contact': [ErrorDetail(string='This field is required.', code='required')]}
  </code></pre>
  
  <p>How can I valid my data with this data structure?</p>