  
  @python_2_unicode_compatible
  class Author(models.Model):
      name = models.CharField(max_length=50, unique=True)
      first_book = models.ForeignKey('Book', related_name='first_time_authors')
      favorite_authors = models.ManyToManyField(
          'self', through='FavoriteAuthors', symmetrical=False, related_name='favors_me')
  
      def __str__(self):
          return self.name
 
</s> remove     first_book = models.ForeignKey('Book', related_name='first_time_authors+')
 </s> add     first_book = models.ForeignKey('Book', models.CASCADE, related_name='first_time_authors+') </s> remove     greatest_fan = models.ForeignKey("Fan", null=True, unique=True)
 </s> add     greatest_fan = models.ForeignKey("Fan", models.SET_NULL, null=True, unique=True) </s> remove     extra = models.ForeignKey(ExtraInfo)
 </s> add     extra = models.ForeignKey(ExtraInfo, models.CASCADE) </s> remove     poet = models.ForeignKey(Poet)
 </s> add     poet = models.ForeignKey(Poet, models.CASCADE) </s> remove     one = models.ForeignKey(CyclicOne)
 </s> add     one = models.ForeignKey(CyclicOne, models.CASCADE)
    first_book = models.ForeignKey('Book', models.CASCADE, related_name='first_time_authors')
  
  @python_2_unicode_compatible
  class Author(models.Model):
      name = models.CharField(max_length=50, unique=True)
    first_book = models.ForeignKey('Book', models.CASCADE, related_name='first_time_authors')
      favorite_authors = models.ManyToManyField(
          'self', through='FavoriteAuthors', symmetrical=False, related_name='favors_me')
  
      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/prefetch_related/models.py