          def __str__(self):              # __unicode__ on Python 2
              return "%s the restaurant" % self.place.name
  
      class Waiter(models.Model):
          restaurant = models.ForeignKey(Restaurant)
          name = models.CharField(max_length=50)
  
          def __str__(self):              # __unicode__ on Python 2
              return "%s the waiter at %s" % (self.name, self.restaurant)
  
 
</s> remove         person = models.ForeignKey(Person)
        group = models.ForeignKey(Group)
 </s> add         person = models.ForeignKey(Person, on_delete=models.CASCADE)
        group = models.ForeignKey(Group, on_delete=models.CASCADE) </s> remove     lesson_entry = models.ForeignKey(LessonEntry)
 </s> add     lesson_entry = models.ForeignKey(LessonEntry, models.CASCADE) </s> remove     owner = models.ForeignKey(User)
 </s> add     owner = models.ForeignKey(User, models.CASCADE) </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     restaurant = models.ForeignKey(Restaurant)
 </s> add     restaurant = models.ForeignKey(Restaurant, models.CASCADE)
        restaurant = models.ForeignKey(Restaurant, on_delete=models.CASCADE)
          def __str__(self):              # __unicode__ on Python 2
              return "%s the restaurant" % self.place.name
  
      class Waiter(models.Model):
        restaurant = models.ForeignKey(Restaurant, on_delete=models.CASCADE)
          name = models.CharField(max_length=50)
  
          def __str__(self):              # __unicode__ on Python 2
              return "%s the waiter at %s" % (self.name, self.restaurant)
  
keep keep keep keep replace keep keep keep keep keep
 Fixed #21127 -- Started deprecation toward requiring on_delete for ForeignKey/OneToOneField 
docs/topics/db/examples/one_to_one.txt