  
  @python_2_unicode_compatible
  class Plot(models.Model):
      name = models.CharField(max_length=100)
      team_leader = models.ForeignKey(Villain, related_name='lead_plots')
      contact = models.ForeignKey(Villain, related_name='contact_plots')
      tags = GenericRelation(FunkyTag)
  
      def __str__(self):
          return self.name
  
 
</s> remove     villain = models.ForeignKey(Villain)
 </s> add     villain = models.ForeignKey(Villain, models.CASCADE) </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     department = models.ForeignKey(Department, to_field="code")
 </s> add     department = models.ForeignKey(Department, models.CASCADE, to_field="code") </s> remove     team = models.ForeignKey(Team, null=True)
 </s> add     team = models.ForeignKey(Team, models.SET_NULL, null=True)
    team_leader = models.ForeignKey(Villain, models.CASCADE, related_name='lead_plots')
    contact = models.ForeignKey(Villain, models.CASCADE, related_name='contact_plots')
  
  @python_2_unicode_compatible
  class Plot(models.Model):
      name = models.CharField(max_length=100)
    team_leader = models.ForeignKey(Villain, models.CASCADE, related_name='lead_plots')
    contact = models.ForeignKey(Villain, models.CASCADE, related_name='contact_plots')
    team_leader = models.ForeignKey(Villain, models.CASCADE, related_name='lead_plots')
    contact = models.ForeignKey(Villain, models.CASCADE, related_name='contact_plots')
      tags = GenericRelation(FunkyTag)
  
      def __str__(self):
          return self.name
  
keep keep keep keep replace replace keep keep keep keep keep
 Fixed #21127 -- Started deprecation toward requiring on_delete for ForeignKey/OneToOneField 
tests/admin_views/models.py