summaryrefslogtreecommitdiff
path: root/app/fieldnotes/models.py
diff options
context:
space:
mode:
authorluxagraf <sng@luxagraf.net>2020-08-06 14:59:54 -0400
committerluxagraf <sng@luxagraf.net>2020-08-06 14:59:54 -0400
commit9033041ac16c51c943e593e2a67420ea20b6d3a5 (patch)
treeae94fcb82701cadacade32cf1008d6c83b64809e /app/fieldnotes/models.py
parent1c8542bba4404932c621af0d9d93813218340af1 (diff)
Made Field notes top level and included photos in archive list
Diffstat (limited to 'app/fieldnotes/models.py')
-rw-r--r--app/fieldnotes/models.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/app/fieldnotes/models.py b/app/fieldnotes/models.py
index e3cb527..c14ba80 100644
--- a/app/fieldnotes/models.py
+++ b/app/fieldnotes/models.py
@@ -47,6 +47,9 @@ class FieldNote(models.Model):
def get_absolute_url(self):
return reverse("fieldnotes:detail", kwargs={"year": self.pub_date.year, "month": self.pub_date.strftime("%m"), "slug": self.slug})
+ def get_object_type(self):
+ return 'fieldnote'
+
@property
def region(self):
return self.location.lux_region
@@ -94,8 +97,7 @@ class FieldNote(models.Model):
if not self.id:
self.pub_date = timezone.now()
self.date_last_updated = timezone.now()
- if self.note_type == 1:
- self.featured_image = extract_main_image(self.body_markdown)
+ self.featured_image = extract_main_image(self.body_markdown)
super(FieldNote, self).save()