summaryrefslogtreecommitdiff
path: root/app/jrnl/models.py
diff options
context:
space:
mode:
Diffstat (limited to 'app/jrnl/models.py')
-rw-r--r--app/jrnl/models.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/app/jrnl/models.py b/app/jrnl/models.py
index 7332321..d0b9120 100644
--- a/app/jrnl/models.py
+++ b/app/jrnl/models.py
@@ -4,7 +4,7 @@ import re
from django.contrib.gis.db import models
from django.utils.html import format_html
-from django.core.urlresolvers import reverse
+from django.urls import reverse
from django.template.loader import render_to_string
from django.conf import settings
from django.template import Context
@@ -62,13 +62,13 @@ class Entry(models.Model):
pub_date = models.DateTimeField('Date published')
enable_comments = models.BooleanField(default=False)
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)
PUB_STATUS = (
(0, 'Draft'),
(1, 'Published'),
)
status = models.IntegerField(choices=PUB_STATUS, default=0)
- photo_gallery = models.ForeignKey(PhotoGallery, blank=True, null=True, verbose_name='photo set')
+ photo_gallery = models.ForeignKey(PhotoGallery, on_delete=models.CASCADE, blank=True, null=True, verbose_name='photo set')
image = models.FileField(upload_to=get_upload_path, null=True, blank=True, help_text="should be 520 by 290")
thumbnail = models.FileField(upload_to=get_tn_path, null=True, blank=True, help_text="should be 160 wide")
meta_description = models.CharField(max_length=256, null=True, blank=True)
@@ -81,7 +81,7 @@ class Entry(models.Model):
(5, 'double-black'),
)
template_name = models.IntegerField(choices=TEMPLATES, default=0)
- featured_image = models.ForeignKey(LuxImage, null=True, blank=True)
+ featured_image = models.ForeignKey(LuxImage, on_delete=models.CASCADE, null=True, blank=True)
has_video = models.BooleanField(blank=True, default=False)
class Meta:
@@ -186,7 +186,7 @@ class HomepageCurrator(models.Model):
image_offset_vertical = models.CharField(max_length=20, help_text="add negative top margin to shift image (include css unit)")
images = models.ManyToManyField(LuxImage)
tag_line = models.CharField(max_length=200)
- featured = models.ForeignKey(Entry, related_name="banner")
+ featured = models.ForeignKey(Entry, on_delete=models.CASCADE, related_name="banner")
popular = models.ManyToManyField(Entry)
template_name = models.CharField(max_length=200, help_text="full path")