summaryrefslogtreecommitdiff
path: root/news/views.py
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2013-04-16 21:51:18 -0500
committerDan McGee <dan@archlinux.org>2013-04-16 21:51:18 -0500
commit1f126744417f40c1a27e8d53054b7bc588d12a00 (patch)
tree9e5ac33a84cd4ee6488c15864c20eddb12cbf26d /news/views.py
parent283cd944beefce8e364f238f25133e2d65b7702b (diff)
Grab author when loading news item details
Saves a query to the database. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'news/views.py')
-rw-r--r--news/views.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/news/views.py b/news/views.py
index 62d30fde..ca4fdf97 100644
--- a/news/views.py
+++ b/news/views.py
@@ -18,7 +18,7 @@ class NewsForm(forms.ModelForm):
class NewsDetailView(DetailView):
- model = News
+ queryset = News.objects.all().select_related('author')
template_name = "news/view.html"