]> git.0d.be Git - chloro.git/blobdiff - chloro/phyll/views.py
views: add an "archives" view
[chloro.git] / chloro / phyll / views.py
index 5264298ba77e3e263727d440f23c61ecd18ee034..78d2fec19de64e18ec5804ac5b91fe5cce7e3044 100644 (file)
@@ -66,6 +66,16 @@ class HomeView(TemplateView):
     template_name = 'phyll/home.html'
 
 
+class ArchivesView(ListView):
+    model = Note
+
+    def get_queryset(self):
+        qs = super(ArchivesView, self).get_queryset()
+        if not self.request.user.is_staff:
+            qs = qs.filter(published=True)
+        return qs
+
+
 class ListOnTagView(ListView):
     model = Note