Grab author when loading news item details

Saves a query to the database.

Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
Dan McGee 2013-04-16 21:51:18 -05:00
parent 283cd944be
commit 1f12674441

View File

@ -18,7 +18,7 @@ class Meta:
class NewsDetailView(DetailView):
model = News
queryset = News.objects.all().select_related('author')
template_name = "news/view.html"