diff ygroup/views.py @ 1080:db8f5b3204b7

Fix Yahoo Group post view for V3 design.
author Brian Neal <bgneal@gmail.com>
date Sat, 23 Apr 2016 00:06:32 -0500
parents 5d208c3321ce
children
line wrap: on
line diff
--- a/ygroup/views.py	Sat Apr 23 00:01:40 2016 -0500
+++ b/ygroup/views.py	Sat Apr 23 00:06:32 2016 -0500
@@ -3,7 +3,7 @@
 
 """
 from django.shortcuts import get_object_or_404
-from django.views.generic import ListView
+from django.views.generic import ListView, DetailView
 
 from ygroup.models import Thread, Post
 from core.paginator import DiggPaginator
@@ -60,3 +60,14 @@
         """
         return DiggPaginator(queryset, per_page, body=5, tail=2,
                 margin=3, padding=2, **kwargs)
+
+
+class PostView(DetailView):
+    model = Post
+    context_object_name = 'post'
+    template_name = 'ygroup/v3/post.html'
+
+    def get_context_data(self, **kwargs):
+        context = super(PostView, self).get_context_data(**kwargs)
+        context['V3_DESIGN'] = True
+        return context