  
  
  @python_2_unicode_compatible
  class Car(models.Model):
      owner = models.ForeignKey(User)
      make = models.CharField(max_length=30)
      model = models.CharField(max_length=30)
  
      def __str__(self):
          return "%s %s" % (self.make, self.model)
 
</s> remove         restaurant = models.ForeignKey(Restaurant)
 </s> add         restaurant = models.ForeignKey(Restaurant, on_delete=models.CASCADE) </s> remove     owner = models.ForeignKey(User, null=True, blank=True, on_delete=models.SET_NULL)
 </s> add     owner = models.ForeignKey(User, models.SET_NULL, null=True, blank=True) </s> remove     lesson_entry = models.ForeignKey(LessonEntry)
 </s> add     lesson_entry = models.ForeignKey(LessonEntry, models.CASCADE) </s> remove     leader = models.ForeignKey(Actor)
 </s> add     leader = models.ForeignKey(Actor, models.CASCADE) </s> remove     location = models.ForeignKey(AugmentedLocation)
 </s> add     location = models.ForeignKey(AugmentedLocation, models.CASCADE)
    owner = models.ForeignKey(User, models.CASCADE)
  
  
  @python_2_unicode_compatible
  class Car(models.Model):
    owner = models.ForeignKey(User, models.CASCADE)
      make = models.CharField(max_length=30)
      model = models.CharField(max_length=30)
  
      def __str__(self):
          return "%s %s" % (self.make, self.model)
keep keep keep keep replace keep keep keep keep keep
 Fixed #21127 -- Started deprecation toward requiring on_delete for ForeignKey/OneToOneField 
tests/admin_widgets/models.py