  
  
  @python_2_unicode_compatible
  class WordEntry(models.Model):
      lesson_entry = models.ForeignKey(LessonEntry)
      name = models.CharField(max_length=200)
  
      def __str__(self):
          return "%s (%s)" % (self.name, self.id)
  
 
</s> remove         restaurant = models.ForeignKey(Restaurant)
 </s> add         restaurant = models.ForeignKey(Restaurant, on_delete=models.CASCADE) </s> remove     owner = models.ForeignKey(User)
 </s> add     owner = models.ForeignKey(User, models.CASCADE) </s> remove     content_type = models.ForeignKey(ContentType)
 </s> add     content_type = models.ForeignKey(ContentType, models.CASCADE) </s> remove     parent = models.OneToOneField(Place, primary_key=True, parent_link=True)
 </s> add     parent = models.OneToOneField(Place, models.CASCADE, primary_key=True, parent_link=True) </s> remove     city = models.ForeignKey(City)
 </s> add     city = models.ForeignKey(City, models.CASCADE)
    lesson_entry = models.ForeignKey(LessonEntry, models.CASCADE)
  
  
  @python_2_unicode_compatible
  class WordEntry(models.Model):
    lesson_entry = models.ForeignKey(LessonEntry, models.CASCADE)
      name = models.CharField(max_length=200)
  
      def __str__(self):
          return "%s (%s)" % (self.name, self.id)
  
keep keep keep keep replace keep keep keep keep keep
 Fixed #21127 -- Started deprecation toward requiring on_delete for ForeignKey/OneToOneField 
tests/prefetch_related/models.py