  @python_2_unicode_compatible
  class Book(models.Model):
      title = models.CharField(max_length=50)
      year = models.PositiveIntegerField(null=True, blank=True)
      author = models.ForeignKey(User, verbose_name="Verbose Author", related_name='books_authored', blank=True, null=True)
      contributors = models.ManyToManyField(User, verbose_name="Verbose Contributors", related_name='books_contributed', blank=True)
      is_best_seller = models.NullBooleanField(default=0)
      date_registered = models.DateField(null=True)
      no = models.IntegerField(verbose_name='number', blank=True, null=True)  # This field is intentionally 2 characters long. See #16080.
  
 
</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     user = models.ForeignKey(settings.AUTH_USER_MODEL, verbose_name=_('user'))
    content_type = models.ForeignKey(ContentType, verbose_name=_('content type'), blank=True, null=True)
 </s> add     user = models.ForeignKey(
        settings.AUTH_USER_MODEL,
        models.CASCADE,
        verbose_name=_('user'),
    )
    content_type = models.ForeignKey(
        ContentType,
        models.SET_NULL,
        verbose_name=_('content type'),
        blank=True, null=True,
    ) </s> remove         parent = models.ForeignKey(RangesModel, blank=True, null=True)
 </s> add         parent = models.ForeignKey(RangesModel, models.SET_NULL, blank=True, null=True) </s> remove     parent = models.ForeignKey('self', to_field='barcode', blank=True, null=True)
 </s> add     parent = models.ForeignKey('self', models.SET_NULL, to_field='barcode', blank=True, null=True) </s> remove     collection = models.ForeignKey(TitleCollection, blank=True, null=True)
 </s> add     collection = models.ForeignKey(TitleCollection, models.SET_NULL, blank=True, null=True)
    author = models.ForeignKey(
        User,
        models.SET_NULL,
        verbose_name="Verbose Author",
        related_name='books_authored',
        blank=True, null=True,
    )
  @python_2_unicode_compatible
  class Book(models.Model):
      title = models.CharField(max_length=50)
      year = models.PositiveIntegerField(null=True, blank=True)
    author = models.ForeignKey(
        User,
        models.SET_NULL,
        verbose_name="Verbose Author",
        related_name='books_authored',
        blank=True, null=True,
    )
      contributors = models.ManyToManyField(User, verbose_name="Verbose Contributors", related_name='books_contributed', blank=True)
      is_best_seller = models.NullBooleanField(default=0)
      date_registered = models.DateField(null=True)
      no = models.IntegerField(verbose_name='number', blank=True, null=True)  # This field is intentionally 2 characters long. See #16080.
  
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