foreign key on delete arguments

Solutions on MaxInterview for foreign key on delete arguments by the best coders in the world

showing results for - "foreign key on delete arguments"
Lucille
13 Apr 2016
1class Artist(models.Model):
2    name = models.CharField(max_length=10)
3
4class Album(models.Model):
5    artist = models.ForeignKey(Artist, on_delete=models.CASCADE)
6
7class Song(models.Model):
8    artist = models.ForeignKey(Artist, on_delete=models.CASCADE)
9    album = models.ForeignKey(Album, on_delete=models.RESTRICT)
10
similar questions
queries leading to this page
foreign key on delete arguments