diff options
author | Dan McGee <dan@archlinux.org> | 2010-01-31 15:19:12 -0600 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2010-01-31 15:19:12 -0600 |
commit | f58b354a037d2c46fd8db9320f8ba29c9e014436 (patch) | |
tree | 05aaea7bcd1a055af9d873482a40b7ecdc44a082 /feeds.py | |
parent | e0eed01914752ee98d50aeab748f71b24df94dc6 (diff) |
Use select_related() to make a few more places more performant
Especially when looking at packages, we always want the arch and repo.
Another big hunk of changes deals with the very inefficient signoffs code.
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'feeds.py')
-rw-r--r-- | feeds.py | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -9,7 +9,7 @@ class PackageFeed(Feed): description = 'Recent Package Updates' def items(self): - return Package.objects.order_by('-last_update')[:24] + return Package.objects.select_related('arch', 'repo').order_by('-last_update')[:24] def item_pubdate(self, item): return item.last_update @@ -23,7 +23,7 @@ class NewsFeed(Feed): description = 'Recent News Updates' def items(self): - return News.objects.order_by('-postdate', '-id')[:10] + return News.objects.select_related('author').order_by('-postdate', '-id')[:10] def item_pubdate(self, item): d = item.postdate |