  
  @python_2_unicode_compatible
  class ParkingLot(Place):
      # An explicit link to the parent (we can control the attribute name).
      parent = models.OneToOneField(Place, primary_key=True, parent_link=True)
      main_site = models.ForeignKey(Place, related_name='lot')
  
      def __str__(self):
          return "%s the parking lot" % self.name
  
  
 
</s> remove     parent = models.OneToOneField(Place, primary_key=True, parent_link=True)
 </s> add     parent = models.OneToOneField(Place, models.CASCADE, primary_key=True, parent_link=True) </s> remove     parent = models.OneToOneField(Place, parent_link=True)
 </s> add     parent = models.OneToOneField(Place, models.CASCADE, parent_link=True) </s> remove     parent = models.OneToOneField(Place, parent_link=True)
 </s> add     parent = models.OneToOneField(Place, models.CASCADE, parent_link=True) </s> remove         restaurant = models.ForeignKey(Restaurant)
 </s> add         restaurant = models.ForeignKey(Restaurant, on_delete=models.CASCADE) </s> remove     parent = models.OneToOneField(Place)
 </s> add     parent = models.OneToOneField(Place, models.CASCADE)
    parent = models.OneToOneField(Place, models.CASCADE, primary_key=True, parent_link=True)
    main_site = models.ForeignKey(Place, models.CASCADE, related_name='lot')
  
  @python_2_unicode_compatible
  class ParkingLot(Place):
      # An explicit link to the parent (we can control the attribute name).
    parent = models.OneToOneField(Place, models.CASCADE, primary_key=True, parent_link=True)
    main_site = models.ForeignKey(Place, models.CASCADE, related_name='lot')
    parent = models.OneToOneField(Place, models.CASCADE, primary_key=True, parent_link=True)
    main_site = models.ForeignKey(Place, models.CASCADE, related_name='lot')
  
      def __str__(self):
          return "%s the parking lot" % self.name
  
  
keep keep keep keep replace replace keep keep keep keep keep
 Fixed #21127 -- Started deprecation toward requiring on_delete for ForeignKey/OneToOneField 
tests/model_inheritance/models.py