We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4c5c065 commit 846fe5fCopy full SHA for 846fe5f
1 file changed
example/gallery/models.py
@@ -13,7 +13,7 @@ def __str__(self):
13
14
class Image(models.Model):
15
file = models.FileField('File', upload_to='images/')
16
- gallery = models.ForeignKey('Gallery', related_name='images', blank=True, null=True)
+ gallery = models.ForeignKey('Gallery', related_name='images', blank=True, null=True, on_delete=models.SET_NULL)
17
18
def __str__(self):
19
return self.filename
0 commit comments