summaryrefslogtreecommitdiff
path: root/app/pages/views.py
diff options
context:
space:
mode:
Diffstat (limited to 'app/pages/views.py')
-rw-r--r--app/pages/views.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/app/pages/views.py b/app/pages/views.py
new file mode 100644
index 0000000..41288dd
--- /dev/null
+++ b/app/pages/views.py
@@ -0,0 +1,18 @@
+from django.views.generic.detail import DetailView
+from django.contrib.auth.forms import AuthenticationForm
+from pages.models import Page
+
+
+class PageDetailView(DetailView):
+ model = Page
+ slug_field = "slug"
+
+ def get_template_names(self):
+ obj = self.get_object()
+ return ["%s.html" % obj.slug, "pages/%s.html" % obj.slug, 'pages/page.html']
+
+
+class HomePageDetailView(PageDetailView):
+
+ def get_object(self):
+ return Page.objects.get(slug='homepage')