Skip to content

Instantly share code, notes, and snippets.

@gcavalcante8808
Created June 8, 2013 14:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gcavalcante8808/5735426 to your computer and use it in GitHub Desktop.
Save gcavalcante8808/5735426 to your computer and use it in GitHub Desktop.
IronWiki - Views - Article
class ArticleView(ListView):
model = Article
template_name = 'wiki/view.html'
def get_queryset(self, article_id=None):
article_id = self.kwargs.get("article_id")
self.queryset = Article.objects.filter(id=article_id)
return self.queryset
def get_context_data(self, **kwargs):
context = super(ArticleView, self).get_context_data(**kwargs)
context['nodes'] = self.queryset
return context
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment