  
  @python_2_unicode_compatible
  class Sketch(models.Model):
      title = models.CharField(max_length=100)
      inquisition = models.ForeignKey(Inquisition, limit_choices_to={'leader__name': 'Palin',
                                                                     'leader__age': 27,
                                                                     'expected': False,
                                                                     })
      defendant0 = models.ForeignKey(Actor, limit_choices_to={'title__isnull': False}, related_name='as_defendant0')
      defendant1 = models.ForeignKey(Actor, limit_choices_to={'title__isnull': True}, related_name='as_defendant1')
  
      def __str__(self):
          return self.title
  
  
 
</s> remove     author = models.ForeignKey(Author)
 </s> add     author = models.ForeignKey(Author, models.CASCADE) </s> remove     leader = models.ForeignKey(Actor)
 </s> add     leader = models.ForeignKey(Actor, models.CASCADE) </s> remove     color = models.ForeignKey(Color, limit_choices_to={'warm': True})
 </s> add     color = models.ForeignKey(Color, models.CASCADE, limit_choices_to={'warm': True}) </s> remove     section = models.ForeignKey(Section, null=True, blank=True)
    sub_section = models.ForeignKey(Section, null=True, blank=True, on_delete=models.SET_NULL, related_name='+')
 </s> add     section = models.ForeignKey(Section, models.CASCADE, null=True, blank=True)
    sub_section = models.ForeignKey(Section, models.SET_NULL, null=True, blank=True, related_name='+') </s> remove     item = models.ForeignKey(Item)
 </s> add     item = models.ForeignKey(Item, models.CASCADE)
    inquisition = models.ForeignKey(
        Inquisition,
        models.CASCADE,
        limit_choices_to={
            'leader__name': 'Palin',
            'leader__age': 27,
            'expected': False,
        },
    )
    defendant0 = models.ForeignKey(
        Actor,
        models.CASCADE,
        limit_choices_to={'title__isnull': False},
        related_name='as_defendant0',
    )
    defendant1 = models.ForeignKey(
        Actor,
        models.CASCADE,
        limit_choices_to={'title__isnull': True},
        related_name='as_defendant1',
    )
  
  @python_2_unicode_compatible
  class Sketch(models.Model):
      title = models.CharField(max_length=100)
    inquisition = models.ForeignKey(
        Inquisition,
        models.CASCADE,
        limit_choices_to={
            'leader__name': 'Palin',
            'leader__age': 27,
            'expected': False,
        },
    )
    defendant0 = models.ForeignKey(
        Actor,
        models.CASCADE,
        limit_choices_to={'title__isnull': False},
        related_name='as_defendant0',
    )
    defendant1 = models.ForeignKey(
        Actor,
        models.CASCADE,
        limit_choices_to={'title__isnull': True},
        related_name='as_defendant1',
    )
    inquisition = models.ForeignKey(
        Inquisition,
        models.CASCADE,
        limit_choices_to={
            'leader__name': 'Palin',
            'leader__age': 27,
            'expected': False,
        },
    )
    defendant0 = models.ForeignKey(
        Actor,
        models.CASCADE,
        limit_choices_to={'title__isnull': False},
        related_name='as_defendant0',
    )
    defendant1 = models.ForeignKey(
        Actor,
        models.CASCADE,
        limit_choices_to={'title__isnull': True},
        related_name='as_defendant1',
    )
    inquisition = models.ForeignKey(
        Inquisition,
        models.CASCADE,
        limit_choices_to={
            'leader__name': 'Palin',
            'leader__age': 27,
            'expected': False,
        },
    )
    defendant0 = models.ForeignKey(
        Actor,
        models.CASCADE,
        limit_choices_to={'title__isnull': False},
        related_name='as_defendant0',
    )
    defendant1 = models.ForeignKey(
        Actor,
        models.CASCADE,
        limit_choices_to={'title__isnull': True},
        related_name='as_defendant1',
    )
    inquisition = models.ForeignKey(
        Inquisition,
        models.CASCADE,
        limit_choices_to={
            'leader__name': 'Palin',
            'leader__age': 27,
            'expected': False,
        },
    )
    defendant0 = models.ForeignKey(
        Actor,
        models.CASCADE,
        limit_choices_to={'title__isnull': False},
        related_name='as_defendant0',
    )
    defendant1 = models.ForeignKey(
        Actor,
        models.CASCADE,
        limit_choices_to={'title__isnull': True},
        related_name='as_defendant1',
    )
    inquisition = models.ForeignKey(
        Inquisition,
        models.CASCADE,
        limit_choices_to={
            'leader__name': 'Palin',
            'leader__age': 27,
            'expected': False,
        },
    )
    defendant0 = models.ForeignKey(
        Actor,
        models.CASCADE,
        limit_choices_to={'title__isnull': False},
        related_name='as_defendant0',
    )
    defendant1 = models.ForeignKey(
        Actor,
        models.CASCADE,
        limit_choices_to={'title__isnull': True},
        related_name='as_defendant1',
    )
    inquisition = models.ForeignKey(
        Inquisition,
        models.CASCADE,
        limit_choices_to={
            'leader__name': 'Palin',
            'leader__age': 27,
            'expected': False,
        },
    )
    defendant0 = models.ForeignKey(
        Actor,
        models.CASCADE,
        limit_choices_to={'title__isnull': False},
        related_name='as_defendant0',
    )
    defendant1 = models.ForeignKey(
        Actor,
        models.CASCADE,
        limit_choices_to={'title__isnull': True},
        related_name='as_defendant1',
    )
  
      def __str__(self):
          return self.title
  
  
keep keep keep keep replace replace replace replace replace replace keep keep keep keep keep
 Fixed #21127 -- Started deprecation toward requiring on_delete for ForeignKey/OneToOneField 
tests/admin_views/models.py