title: Serialize Objects with One-to-One Relationship Django
body: <p>I am a newbie in django. I am working on a rest api. I have an optional "is a" relationship i.e Student is a Employee. I am trying to serialize these 2 models such that I get combined json result. Please let me know if anyone can help me with this. Thanks</p>
  
  <pre><code>class Employee(models.Model):
      full_name=models.CharField(max_length=100,blank=True)
      email_id=models.EmailField(max_length=100,blank=True)
      mobile_no=models.CharField(max_length=11,blank=True)
      is_job_ready=models.BooleanField(False)
      type=models.CharField(max_length=20,blank=True)
      location_preference=models.CharField(max_length=20,blank=True)
  
  class Student(models.Model):
      college=models.CharField(max_length=100)
      year=models.CharField(max_length=20)
      is_with_college=models.BooleanField()
      employee=models.OneToOneField(Employee,primary_key=True)
  </code></pre>