Created
June 8, 2013 14:59
-
-
Save gcavalcante8808/5735426 to your computer and use it in GitHub Desktop.
IronWiki - Views - Article
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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