X-Git-Url: https://git.sommitrealweird.co.uk/sommitrealweird.git/blobdiff_plain/6746b20632b76e4a04be07428ab2581483869d40..refs/heads/django-4.2:/sommitrealweird/photo/models.py?ds=inline diff --git a/sommitrealweird/photo/models.py b/sommitrealweird/photo/models.py index 3a5d123..31751c3 100644 --- a/sommitrealweird/photo/models.py +++ b/sommitrealweird/photo/models.py @@ -26,7 +26,7 @@ class Photo(models.Model): image = models.ImageField(upload_to=get_upload_path, null=True) caption = models.TextField(blank=True, null=True) order = models.IntegerField(blank=True, null=True) - album = models.ForeignKey('Album') + album = models.ForeignKey('Album', on_delete=models.CASCADE) def __unicode__(self): return "%s" %(self.image)