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:
parent
283cd944be
commit
1f12674441
@ -18,7 +18,7 @@ class Meta:
|
||||
|
||||
|
||||
class NewsDetailView(DetailView):
|
||||
model = News
|
||||
queryset = News.objects.all().select_related('author')
|
||||
template_name = "news/view.html"
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user