diff options
author | Dan McGee <dan@archlinux.org> | 2013-04-17 04:51:18 +0200 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2013-04-17 04:51:18 +0200 |
commit | 1f126744417f40c1a27e8d53054b7bc588d12a00 (patch) | |
tree | 9e5ac33a84cd4ee6488c15864c20eddb12cbf26d | |
parent | 283cd944beefce8e364f238f25133e2d65b7702b (diff) | |
download | archweb-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.py | 2 |
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" |