summaryrefslogtreecommitdiff
path: root/sitemaps.py
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2011-06-15 15:50:14 -0500
committerDan McGee <dan@archlinux.org>2011-06-15 15:50:14 -0500
commit4a9b6867a3a2786435316ab7deefa54257bb931d (patch)
tree3b0cfc08238dcf6b67dac16b8c35bc26b14b213a /sitemaps.py
parenteb231660b017eab886ecd98828bf0295e36a1112 (diff)
Refactor common select_related into manager method
For a Package object query, we almost always did .select_related('arch', 'repo). Refactor this into the manager as a 'normal()' method so we can avoid sprinkling the same logic everywhere. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'sitemaps.py')
-rw-r--r--sitemaps.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/sitemaps.py b/sitemaps.py
index e321fe85..1a3669ad 100644
--- a/sitemaps.py
+++ b/sitemaps.py
@@ -8,8 +8,7 @@ class PackagesSitemap(Sitemap):
priority = "0.5"
def items(self):
- return Package.objects.select_related('arch', 'repo').all()
- return Package.objects.all()
+ return Package.objects.normal()
def lastmod(self, obj):
return obj.last_update