  class Child(models.Model):
      name = models.CharField(max_length=50)
      teacher = models.ForeignKey(Teacher)
  
      content_type = models.ForeignKey(ContentType)
      object_id = models.PositiveIntegerField()
      parent = GenericForeignKey()
  
      def __str__(self):
          return 'I am %s, a child of %s' % (self.name, self.parent)
 
</s> remove     teacher = models.ForeignKey(Teacher)
 </s> add     teacher = models.ForeignKey(Teacher, models.CASCADE) </s> remove     content_type = models.ForeignKey(ContentType)
 </s> add     content_type = models.ForeignKey(ContentType, models.CASCADE) </s> remove             content_type = models.ForeignKey(ContentType)
 </s> add             content_type = models.ForeignKey(ContentType, models.CASCADE) </s> remove             content_type = models.ForeignKey(ContentType)
 </s> add             content_type = models.ForeignKey(ContentType, models.CASCADE) </s> remove             content_type = models.ForeignKey(ContentType)
 </s> add             content_type = models.ForeignKey(ContentType, models.CASCADE)
    content_type = models.ForeignKey(ContentType, models.CASCADE)
  class Child(models.Model):
      name = models.CharField(max_length=50)
      teacher = models.ForeignKey(Teacher)
  
    content_type = models.ForeignKey(ContentType, models.CASCADE)
      object_id = models.PositiveIntegerField()
      parent = GenericForeignKey()
  
      def __str__(self):
          return 'I am %s, a child of %s' % (self.name, self.parent)
keep keep keep keep replace keep keep keep keep keep
 Fixed #21127 -- Started deprecation toward requiring on_delete for ForeignKey/OneToOneField 
tests/admin_inlines/models.py