  
  
  class OneToOneTargetSource(models.Model):
      name = models.CharField(max_length=100)
      target = models.OneToOneField(OneToOneTarget, related_name='target_source')
  
  
  class OneToOneSource(models.Model):
      name = models.CharField(max_length=100)
      target_source = models.OneToOneField(OneToOneTargetSource, related_name='source')
 
</s>
    target = models.OneToOneField(OneToOneTarget, null=True, blank=True,
                                  related_name='target_source')
  
  
  class OneToOneTargetSource(models.Model):
      name = models.CharField(max_length=100)
    target = models.OneToOneField(OneToOneTarget, null=True, blank=True,
                                  related_name='target_source')
  
  
  class OneToOneSource(models.Model):
      name = models.CharField(max_length=100)
      target_source = models.OneToOneField(OneToOneTargetSource, related_name='source')
keep keep keep keep replace keep keep keep keep keep
 Add one-to-one nested update and delete functionality
rest_framework/tests/nesting.py