diff options
Diffstat (limited to 'app/photos')
-rw-r--r-- | app/photos/build.py | 2 | ||||
-rw-r--r-- | app/photos/models.py | 14 |
2 files changed, 8 insertions, 8 deletions
diff --git a/app/photos/build.py b/app/photos/build.py index 15a649e..b11c756 100644 --- a/app/photos/build.py +++ b/app/photos/build.py @@ -1,5 +1,5 @@ import os -from django.core.urlresolvers import reverse +from django.urls import reverse from builder.base import BuildNew diff --git a/app/photos/models.py b/app/photos/models.py index 603e2d1..84ceb0f 100644 --- a/app/photos/models.py +++ b/app/photos/models.py @@ -64,7 +64,7 @@ class LuxImage(models.Model): height = models.CharField(max_length=6, blank=True, null=True) width = models.CharField(max_length=6, blank=True, null=True) point = models.PointField(null=True, blank=True) - location = models.ForeignKey(Location, null=True, blank=True) + location = models.ForeignKey(Location, on_delete=models.CASCADE, null=True, blank=True) is_public = models.BooleanField(default=True) sizes = models.ManyToManyField(LuxImageSize, blank=True) flickr_id = models.CharField(null=True, blank=True, max_length=80) @@ -226,11 +226,11 @@ class LuxGallery(models.Model): title = models.CharField(blank=True, max_length=300) description = models.TextField(blank=True, null=True) slug = models.CharField(blank=True, max_length=300) - thumb = models.ForeignKey(LuxImage, related_name="gallery_thumb", null=True, blank=True) + thumb = models.ForeignKey(LuxImage, on_delete=models.CASCADE, related_name="gallery_thumb", null=True, blank=True) images = models.ManyToManyField(LuxImage) pub_date = models.DateTimeField(null=True) point = models.PointField(null=True, blank=True) - location = models.ForeignKey(Location, null=True, blank=True) + location = models.ForeignKey(Location, on_delete=models.CASCADE, null=True, blank=True) is_public = models.BooleanField(default=True) caption_style = models.CharField(blank=True, null=True, max_length=400) @@ -309,8 +309,8 @@ class Photo(models.Model): flickr_originalsecret = models.CharField(max_length=50) lon = models.FloatField('Longitude', help_text="Longitude of centerpoint", null=True) lat = models.FloatField('Latitude', help_text="Latitude of centerpoint", null=True) - location = models.ForeignKey(Location, null=True) - region = models.ForeignKey(Region, null=True) + location = models.ForeignKey(Location, on_delete=models.CASCADE, null=True) + region = models.ForeignKey(Region, on_delete=models.CASCADE, null=True) slideshowimage_width = models.CharField(max_length=4, blank=True, null=True) slideshowimage_height = models.CharField(max_length=4, blank=True, null=True) slideshowimage_margintop = models.CharField(max_length=4, blank=True, null=True) @@ -453,8 +453,8 @@ class PhotoGallery(models.Model): set_slug = models.CharField(blank=True, max_length=300) primary = models.CharField(blank=True, max_length=300) photos = models.ManyToManyField(Photo) - location = models.ForeignKey(Location, null=True) - region = models.ForeignKey(Region, null=True) + location = models.ForeignKey(Location, on_delete=models.CASCADE, null=True) + region = models.ForeignKey(Region, on_delete=models.CASCADE, null=True) pub_date = models.DateTimeField(null=True) class Meta: |