  @python_2_unicode_compatible
  class Primary(models.Model):
      name = models.CharField(max_length=50)
      value = models.CharField(max_length=50)
      related = models.ForeignKey(Secondary)
  
      def __str__(self):
          return self.name
  
  
 
</s> remove     related = models.OneToOneField(RelatedModel)
 </s> add     related = models.OneToOneField(RelatedModel, models.CASCADE) </s> remove     related = models.ForeignKey(RelatedModel)
 </s> add     related = models.ForeignKey(RelatedModel, models.CASCADE) </s> remove     country = models.ForeignKey(Country)
 </s> add     country = models.ForeignKey(Country, models.CASCADE) </s> remove     restaurant = models.ForeignKey(Restaurant)
 </s> add     restaurant = models.ForeignKey(Restaurant, models.CASCADE) </s> remove     location = models.ForeignKey(Location)
 </s> add     location = models.ForeignKey(Location, models.CASCADE)
    related = models.ForeignKey(Secondary, models.CASCADE)
  @python_2_unicode_compatible
  class Primary(models.Model):
      name = models.CharField(max_length=50)
      value = models.CharField(max_length=50)
    related = models.ForeignKey(Secondary, models.CASCADE)
  
      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/defer/models.py