          def __str__(self):              # __unicode__ on Python 2
              return self.name
  
      class Membership(models.Model):
          person = models.ForeignKey(Person)
          group = models.ForeignKey(Group)
          date_joined = models.DateField()
          invite_reason = models.CharField(max_length=64)
  
  When you set up the intermediary model, you explicitly specify foreign
  keys to the models that are involved in the many-to-many relationship. This
 
</s> remove         restaurant = models.ForeignKey(Restaurant)
 </s> add         restaurant = models.ForeignKey(Restaurant, on_delete=models.CASCADE) </s> remove             person = models.ForeignKey(Person)
            group = models.ForeignKey(Group)
 </s> add             person = models.ForeignKey(Person, models.CASCADE)
            group = models.ForeignKey(Group, models.CASCADE) </s> remove     group = models.ForeignKey(Group)
 </s> add     group = models.ForeignKey(Group, models.CASCADE) </s> remove     person = models.OneToOneField(Member, primary_key=True)
    parent = models.ForeignKey(Member, related_name="children")
 </s> add     person = models.OneToOneField(Member, models.CASCADE, primary_key=True)
    parent = models.ForeignKey(Member, models.CASCADE, related_name="children") </s> remove     music = models.ForeignKey(Musician)
    group = models.ForeignKey(Group)
 </s> add     music = models.ForeignKey(Musician, models.CASCADE)
    group = models.ForeignKey(Group, models.CASCADE)
        person = models.ForeignKey(Person, on_delete=models.CASCADE)
        group = models.ForeignKey(Group, on_delete=models.CASCADE)
          def __str__(self):              # __unicode__ on Python 2
              return self.name
  
      class Membership(models.Model):
        person = models.ForeignKey(Person, on_delete=models.CASCADE)
        group = models.ForeignKey(Group, on_delete=models.CASCADE)
        person = models.ForeignKey(Person, on_delete=models.CASCADE)
        group = models.ForeignKey(Group, on_delete=models.CASCADE)
          date_joined = models.DateField()
          invite_reason = models.CharField(max_length=64)
  
  When you set up the intermediary model, you explicitly specify foreign
  keys to the models that are involved in the many-to-many relationship. This
keep keep keep keep replace replace keep keep keep keep keep
 Fixed #21127 -- Started deprecation toward requiring on_delete for ForeignKey/OneToOneField 
docs/topics/db/models.txt