  
  
  @python_2_unicode_compatible
  class Employee(models.Model):
      department = models.ForeignKey(Department, to_field="code")
      name = models.CharField(max_length=100)
  
      def __str__(self):
          return self.name
  
 
</s> remove     boss = models.ForeignKey('self', null=True,
                             related_name='serfs')
 </s> add     boss = models.ForeignKey('self', models.SET_NULL, null=True, related_name='serfs') </s> remove     poet = models.ForeignKey(Poet)
 </s> add     poet = models.ForeignKey(Poet, models.CASCADE) </s> remove     poet = models.ForeignKey(Poet)
 </s> add     poet = models.ForeignKey(Poet, models.CASCADE) </s> remove     team = models.ForeignKey(Team, null=True)
 </s> add     team = models.ForeignKey(Team, models.SET_NULL, null=True) </s> remove     restaurant = models.ForeignKey(Restaurant)
 </s> add     restaurant = models.ForeignKey(Restaurant, models.CASCADE)
    department = models.ForeignKey(Department, models.CASCADE, to_field="code")
  
  
  @python_2_unicode_compatible
  class Employee(models.Model):
    department = models.ForeignKey(Department, models.CASCADE, to_field="code")
      name = models.CharField(max_length=100)
  
      def __str__(self):
          return self.name
  
keep keep keep keep replace keep keep keep keep keep
 Fixed #21127 -- Started deprecation toward requiring on_delete for ForeignKey/OneToOneField 
tests/admin_filters/models.py