summaryrefslogtreecommitdiff
path: root/app/posts/models.py
diff options
context:
space:
mode:
Diffstat (limited to 'app/posts/models.py')
-rw-r--r--app/posts/models.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/posts/models.py b/app/posts/models.py
index 7322881..93d686a 100644
--- a/app/posts/models.py
+++ b/app/posts/models.py
@@ -41,6 +41,7 @@ def get_upload_path(self, filename):
class Trip(models.Model):
title = models.CharField(max_length=300)
subtitle = models.CharField(max_length=200, blank=True)
+ dek = models.TextField(null=True, blank=True)
slug = models.SlugField()
body_markdown = models.TextField()
body_html = models.TextField(blank=True)
@@ -49,12 +50,15 @@ class Trip(models.Model):
featured_image = models.ForeignKey(LuxImage, on_delete=models.SET_NULL, null=True, blank=True)
order = models.PositiveIntegerField("order", null=True, blank=True)
- def __str_(self):
+ def __str__(self):
return self.title
class Meta:
ordering = ('-order',)
+ def get_absolute_url(self):
+ return reverse('trips:detail', kwargs={"slug": self.slug})
+
def save(self, *args, **kwargs):
created = self.pk is None
if not created: