summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2012-09-30 08:51:49 +0200
committerDan McGee <dan@archlinux.org>2012-09-30 08:51:49 +0200
commit9b373c43aff6b9109ba813fcbcf40c7ac5521b04 (patch)
tree884add8771db8627d2d60bf4bf637e7bd758a00c
parentd127ebf0c9303886e326577e0a91565b654e133d (diff)
downloadarchweb-9b373c43aff6b9109ba813fcbcf40c7ac5521b04.tar.gz
archweb-9b373c43aff6b9109ba813fcbcf40c7ac5521b04.tar.xz
Optimize packages sitemap generation
* Select arch and repo related models as we need the name off each * Only select the fields we actually need from the database * Exclude [staging] packages Signed-off-by: Dan McGee <dan@archlinux.org>
-rw-r--r--sitemaps.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/sitemaps.py b/sitemaps.py
index b53c990..bce3e00 100644
--- a/sitemaps.py
+++ b/sitemaps.py
@@ -13,7 +13,8 @@ class PackagesSitemap(Sitemap):
priority = "0.5"
def items(self):
- return Package.objects.all().order_by()
+ return Package.objects.normal().filter(repo__staging=False).only(
+ 'pkgname', 'last_update', 'repo__name', 'arch__name').order_by()
def lastmod(self, obj):
return obj.last_update