Skip to content

Instantly share code, notes, and snippets.

@neuman
Created February 28, 2014 00:58
Show Gist options
  • Save neuman/9263049 to your computer and use it in GitHub Desktop.
Save neuman/9263049 to your computer and use it in GitHub Desktop.
class PostListView(SiteRootView, TemplateView):
template_name = 'posts.html'
def get_context_data(self, **kwargs):
context = super(PostListView, self).get_context_data(**kwargs)
context['posts'] = cm.Post.objects.all().order_by('-updated_at')
return context
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment