  @python_2_unicode_compatible
  class Article(models.Model):
      title = models.CharField(max_length=100)
      slug = models.SlugField()
      author = models.ForeignKey(Author)
      date_created = models.DateTimeField()
  
      def __str__(self):
          return self.title
  
 
</s> remove     post = models.ForeignKey(PrePopulatedPost)
 </s> add     post = models.ForeignKey(PrePopulatedPost, models.CASCADE) </s> remove     author = models.ForeignKey(Author, related_name='books', null=True)
 </s> add     author = models.ForeignKey(Author, models.SET_NULL, related_name='books', null=True) </s> remove     author = models.ForeignKey(Author)
 </s> add     author = models.ForeignKey(Author, models.CASCADE) </s> remove     author = models.ForeignKey(Author, unique=True)
 </s> add     author = models.ForeignKey(Author, models.CASCADE, unique=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='+')
    author = models.ForeignKey(Author, models.CASCADE)
  @python_2_unicode_compatible
  class Article(models.Model):
      title = models.CharField(max_length=100)
      slug = models.SlugField()
    author = models.ForeignKey(Author, models.CASCADE)
      date_created = models.DateTimeField()
  
      def __str__(self):
          return self.title
  
keep keep keep keep replace keep keep keep keep keep
 Fixed #21127 -- Started deprecation toward requiring on_delete for ForeignKey/OneToOneField 
tests/contenttypes_tests/models.py