]> git.0d.be Git - chloro.git/blobdiff - chloro/phyll/views.py
include latest post on homepage
[chloro.git] / chloro / phyll / views.py
index 78d2fec19de64e18ec5804ac5b91fe5cce7e3044..6f0f0f701fed8dca4047bc50523e1ba902962479 100644 (file)
@@ -65,6 +65,11 @@ class NoteDeleteView(DeleteView):
 class HomeView(TemplateView):
     template_name = 'phyll/home.html'
 
+    def get_context_data(self, **kwargs):
+        context = super(HomeView, self).get_context_data(**kwargs)
+        context['latest'] = Note.objects.filter(published=True).latest('creation_timestamp')
+        return context
+
 
 class ArchivesView(ListView):
     model = Note