diff options
Diffstat (limited to 'app/pages/views.py')
-rw-r--r-- | app/pages/views.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/app/pages/views.py b/app/pages/views.py index 934cb40..026ab36 100644 --- a/app/pages/views.py +++ b/app/pages/views.py @@ -6,3 +6,14 @@ def page(request, slug): obj = get_object_or_404(Page, slug__exact=slug) context = {'object': obj, } return render_to_response(["details/%s.html" % obj.slug, 'details/page.html'], context, context_instance=RequestContext(request)) + +from django.views.generic.detail import DetailView + + +class PageDetailView(DetailView): + model = Page + slug_field = "slug" + + def get_template_names(self): + obj = self.get_object() + return ["details/%s.html" % obj.slug, 'details/page.html'] |