diff options
Diffstat (limited to 'app/posts/models.py')
-rw-r--r-- | app/posts/models.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/app/posts/models.py b/app/posts/models.py index 6705a83..9697f27 100644 --- a/app/posts/models.py +++ b/app/posts/models.py @@ -28,6 +28,7 @@ from normalize.models import RelatedPost from media.models import LuxImage, LuxImageSize from locations.models import Location from books.models import Book +from lttr.models import NewsletterMailing #from fieldnotes.models import FieldNote from taxonomy.models import TaggedItems, Category from utils.util import render_images, render_products, parse_video, markdown_to_html, extract_main_image @@ -105,6 +106,9 @@ class Post(models.Model): def get_absolute_url(self): if self.post_type == PostType.ESSAY: return reverse('essays:detail', kwargs={"slug": self.slug}) + if self.post_type == PostType.RANGE: + m = NewsletterMailing.objects.get(post__id=self.pk) + return reverse('range:range-detail', kwargs={"issue": m.get_issue_str(), "slug": self.slug}) if self.post_type == PostType.SRC: return reverse('src:detail', kwargs={"slug": self.slug}) if self.post_type == PostType.FIELD_NOTE: |