src/spel/views.py
changeset 84 d58673e1dc90
parent 74 ca3207a1c6e3
child 86 ac44ba54cdeb
--- a/src/spel/views.py	Fri Apr 25 12:59:08 2014 +0200
+++ b/src/spel/views.py	Wed May 14 17:02:19 2014 +0200
@@ -37,8 +37,19 @@
     template_name = "spel_theatre.html"
     def get(self, request):
         # Get start and end for date bounds (earliest is available only on django 1.6)
-        start_date = Content.objects.all().order_by("content_creation_date")[0].content_creation_date
-        end_date = Content.objects.latest("content_creation_date").content_creation_date
+        start_date = Content.objects.filter(tags__name__in=["content_theatre"]).order_by("content_creation_date")[0].content_creation_date
+        end_date = Content.objects.filter(tags__name__in=["content_theatre"]).latest("content_creation_date").content_creation_date
+        context = {"start_date":start_date, "end_date":end_date }
+        return self.render_to_response(context)
+
+
+
+class Opera(TemplateView):
+    template_name = "spel_opera.html"
+    def get(self, request):
+        # Get start and end for date bounds (earliest is available only on django 1.6)
+        start_date = Content.objects.filter(tags__name__in=["content_opera"]).order_by("content_creation_date")[0].content_creation_date
+        end_date = Content.objects.filter(tags__name__in=["content_opera"]).latest("content_creation_date").content_creation_date
         context = {"start_date":start_date, "end_date":end_date }
         return self.render_to_response(context)