]> git.0d.be Git - chloro.git/blobdiff - chloro/phyll/views.py
include direct links to latest posts on homepage
[chloro.git] / chloro / phyll / views.py
index 6c8fdabf26d5febc7f7e49fde7221bdbb621355e..84b40e7fd0071ba633ceb553ffd05dfc20cafc3f 100644 (file)
@@ -67,7 +67,7 @@ class HomeView(TemplateView):
 
     def get_context_data(self, **kwargs):
         context = super(HomeView, self).get_context_data(**kwargs)
-        context['latest'] = Note.objects.filter(published=True).latest('creation_timestamp')
+        context['posts'] = Note.objects.filter(published=True).order_by('-creation_timestamp')[:5]
         return context