  
  @python_2_unicode_compatible
  class Thing(models.Model):
      title = models.CharField(max_length=20)
      color = models.ForeignKey(Color, limit_choices_to={'warm': True})
      pub_date = models.DateField(blank=True, null=True)
  
      def __str__(self):
          return self.title
  
 
</s> remove     author = models.ForeignKey(Author)
 </s> add     author = models.ForeignKey(Author, models.CASCADE) </s> remove     reporter = models.ForeignKey(Reporter)
    response_to = models.ForeignKey('self', null=True)
 </s> add     reporter = models.ForeignKey(Reporter, models.CASCADE)
    response_to = models.ForeignKey('self', models.SET_NULL, null=True) </s> remove     question = models.ForeignKey(Question, on_delete=models.PROTECT)
 </s> add     question = models.ForeignKey(Question, models.PROTECT) </s> remove     team = models.ForeignKey(Team, null=True)
 </s> add     team = models.ForeignKey(Team, models.SET_NULL, null=True) </s> remove     parent = models.ForeignKey('self', null=True)
 </s> add     parent = models.ForeignKey('self', models.CASCADE, null=True)
    color = models.ForeignKey(Color, models.CASCADE, limit_choices_to={'warm': True})
  
  @python_2_unicode_compatible
  class Thing(models.Model):
      title = models.CharField(max_length=20)
    color = models.ForeignKey(Color, models.CASCADE, limit_choices_to={'warm': True})
      pub_date = models.DateField(blank=True, null=True)
  
      def __str__(self):
          return self.title
  
keep keep keep keep replace keep keep keep keep keep
 Fixed #21127 -- Started deprecation toward requiring on_delete for ForeignKey/OneToOneField 
tests/admin_views/models.py