summaryrefslogtreecommitdiff
path: root/app/projects
diff options
context:
space:
mode:
Diffstat (limited to 'app/projects')
-rw-r--r--app/projects/models/fiveby.py4
-rw-r--r--app/projects/models/natparks.py7
2 files changed, 5 insertions, 6 deletions
diff --git a/app/projects/models/fiveby.py b/app/projects/models/fiveby.py
index b6c7e33..473c095 100644
--- a/app/projects/models/fiveby.py
+++ b/app/projects/models/fiveby.py
@@ -27,8 +27,8 @@ class FiveBy(models.Model):
)
status = models.IntegerField(choices=PUB_STATUS, default=0)
point = models.PointField(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)
class Meta:
ordering = ('-pub_date',)
diff --git a/app/projects/models/natparks.py b/app/projects/models/natparks.py
index 608c5c3..980d9fa 100644
--- a/app/projects/models/natparks.py
+++ b/app/projects/models/natparks.py
@@ -14,7 +14,7 @@ def get_upload_path(self, filename):
class NationalParks(models.Model):
type = models.CharField(max_length=50)
name = models.CharField(max_length=254)
- state = models.ForeignKey(State, null=True)
+ state = models.ForeignKey(State, on_delete=models.CASCADE, null=True)
size = models.CharField(max_length=10, null=True)
fee = models.CharField(max_length=5, null=True)
camping_fee = models.CharField(max_length=10, null=True)
@@ -29,13 +29,12 @@ class NationalParks(models.Model):
visited = models.BooleanField(default=False)
dek = models.TextField(null=True, blank=True)
tag_line = models.CharField(max_length=254, null=True)
- post = models.ForeignKey(Entry, null=True)
- gallery = models.ForeignKey(PhotoGallery, blank=True, null=True, verbose_name='photo set')
+ post = models.ForeignKey(Entry, on_delete=models.CASCADE, null=True)
+ 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="width: 980px, height: > 450px")
image_height = models.CharField(max_length=20, null=True, blank=True)
image_width = models.CharField(max_length=20, null=True, blank=True)
- objects = models.GeoManager()
class Meta:
verbose_name_plural = "National Parks"