aboutsummaryrefslogtreecommitdiff
path: root/apps/pages/views.py
diff options
context:
space:
mode:
Diffstat (limited to 'apps/pages/views.py')
-rw-r--r--apps/pages/views.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/apps/pages/views.py b/apps/pages/views.py
new file mode 100644
index 0000000..617ce04
--- /dev/null
+++ b/apps/pages/views.py
@@ -0,0 +1,11 @@
+from django.views.generic.detail import DetailView
+from pages.models import Page
+
+
+class PageDetailView(DetailView):
+ model = Page
+ slug_field = "slug"
+
+ def get_template_names(self):
+ obj = self.get_object()
+ return ["pages/%s.html" % obj.slug, 'pages/page.html']