  
  For example::
  
      class EntryDetail(models.Model):
          entry = models.OneToOneField(Entry)
          details = models.TextField()
  
      ed = EntryDetail.objects.get(id=2)
      ed.entry # Returns the related Entry object.
  
 
</s> remove model was altered to ``blog = ForeignKey(Blog, related_name='entries')``, the
above example code would look like this::
 </s> add model was altered to ``blog = ForeignKey(Blog, on_delete=models.CASCADE,
related_name='entries')``, the above example code would look like this:: </s> remove         company_that_makes_it = models.ForeignKey(Manufacturer)
 </s> add         company_that_makes_it = models.ForeignKey(
            Manufacturer,
            on_delete=models.CASCADE,
        ) </s> remove     details = models.OneToOneField(Detail, primary_key=True)
 </s> add     details = models.OneToOneField(Detail, models.CASCADE, primary_key=True) </s> remove     content_type = models.ForeignKey(ContentType)
 </s> add     content_type = models.ForeignKey(ContentType, models.CASCADE) </s> remove     related = models.ForeignKey(RelatedModel)
 </s> add     related = models.ForeignKey(RelatedModel, models.CASCADE)
        entry = models.OneToOneField(Entry, on_delete=models.CASCADE)
  
  For example::
  
      class EntryDetail(models.Model):
        entry = models.OneToOneField(Entry, on_delete=models.CASCADE)
          details = models.TextField()
  
      ed = EntryDetail.objects.get(id=2)
      ed.entry # Returns the related Entry object.
  
keep keep keep keep replace keep keep keep keep keep
 Fixed #21127 -- Started deprecation toward requiring on_delete for ForeignKey/OneToOneField 
docs/topics/db/queries.txt