diff options
Diffstat (limited to 'app/posts/views.py')
-rw-r--r-- | app/posts/views.py | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/app/posts/views.py b/app/posts/views.py index fc85fa7..47c8c86 100644 --- a/app/posts/views.py +++ b/app/posts/views.py @@ -4,7 +4,7 @@ from django.contrib.syndication.views import Feed from django.apps import apps from django.conf import settings -from utils.views import PaginatedListView +from utils.views import PaginatedListView, LuxDetailView from .models import Post from taxonomy.models import Category @@ -40,8 +40,17 @@ class EssayListView(PostList): queryset = super(EssayListView, self).get_queryset() return queryset.filter(post_type__in=[2,]).filter(status__exact=1).order_by('-pub_date').prefetch_related('location').prefetch_related('featured_image') + def get_context_data(self, **kwargs): + ''' + override for custom breadcrumb path + ''' + # Call the base implementation first to get a context + context = super(EssayListView, self).get_context_data(**kwargs) + context['breadcrumbs'] = ('Essays',) + return context -class PostDetailView(DetailView): + +class PostDetailView(LuxDetailView): model = Post slug_field = "slug" @@ -62,6 +71,7 @@ class PostDetailView(DetailView): obj = self.get_object() return ["posts/%s_detail.html" % obj.get_post_type_display(), 'posts/post_detail.html'] + class PostDetailViewTXT(PostDetailView): template_name = "posts/entry_detail.txt" |