include latest post on homepage
[chloro.git] / chloro / phyll / views.py
index 78d2fec..6f0f0f7 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