summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2013-04-17 04:51:18 +0200
committerDan McGee <dan@archlinux.org>2013-04-17 04:51:18 +0200
commit1f126744417f40c1a27e8d53054b7bc588d12a00 (patch)
tree9e5ac33a84cd4ee6488c15864c20eddb12cbf26d
parent283cd944beefce8e364f238f25133e2d65b7702b (diff)
downloadarchweb-1f126744417f40c1a27e8d53054b7bc588d12a00.tar.gz
archweb-1f126744417f40c1a27e8d53054b7bc588d12a00.tar.xz
Grab author when loading news item details
Saves a query to the database. Signed-off-by: Dan McGee <dan@archlinux.org>
-rw-r--r--news/views.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/news/views.py b/news/views.py
index 62d30fd..ca4fdf9 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"