From 1f126744417f40c1a27e8d53054b7bc588d12a00 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Tue, 16 Apr 2013 21:51:18 -0500 Subject: Grab author when loading news item details Saves a query to the database. Signed-off-by: Dan McGee --- news/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'news') 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" -- cgit v1.2.3-24-g4f1b