Mercurial > public > sg101
comparison 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 |
comparison
equal
deleted
inserted
replaced
1079:75189bd9c4ba | 1080:db8f5b3204b7 |
---|---|
1 """ | 1 """ |
2 Views for the ygroup (Yahoo Group Archive) application. | 2 Views for the ygroup (Yahoo Group Archive) application. |
3 | 3 |
4 """ | 4 """ |
5 from django.shortcuts import get_object_or_404 | 5 from django.shortcuts import get_object_or_404 |
6 from django.views.generic import ListView | 6 from django.views.generic import ListView, DetailView |
7 | 7 |
8 from ygroup.models import Thread, Post | 8 from ygroup.models import Thread, Post |
9 from core.paginator import DiggPaginator | 9 from core.paginator import DiggPaginator |
10 | 10 |
11 | 11 |
58 """ | 58 """ |
59 Return an instance of the paginator for this view. | 59 Return an instance of the paginator for this view. |
60 """ | 60 """ |
61 return DiggPaginator(queryset, per_page, body=5, tail=2, | 61 return DiggPaginator(queryset, per_page, body=5, tail=2, |
62 margin=3, padding=2, **kwargs) | 62 margin=3, padding=2, **kwargs) |
63 | |
64 | |
65 class PostView(DetailView): | |
66 model = Post | |
67 context_object_name = 'post' | |
68 template_name = 'ygroup/v3/post.html' | |
69 | |
70 def get_context_data(self, **kwargs): | |
71 context = super(PostView, self).get_context_data(**kwargs) | |
72 context['V3_DESIGN'] = True | |
73 return context |