From 9b373c43aff6b9109ba813fcbcf40c7ac5521b04 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Sun, 30 Sep 2012 01:51:49 -0500 Subject: 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 --- sitemaps.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sitemaps.py b/sitemaps.py index b53c990b..bce3e005 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 -- cgit v1.2.3-55-g3dc8