summaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2010-08-28 00:31:40 +0200
committerDan McGee <dan@archlinux.org>2010-08-28 00:32:52 +0200
commit971e9faf906d686e05b641f497ba37ee605d4a47 (patch)
treea8b38878322646cb26f9e6db5726140bd2b1f137 /packages
parente595665abd8700afc6474f08bef95eea3c986260 (diff)
downloadarchweb-971e9faf906d686e05b641f497ba37ee605d4a47.tar.gz
archweb-971e9faf906d686e05b641f497ba37ee605d4a47.tar.xz
Add package groups to front page and cache results
Make it more visible to the public, and cache the results of the group information function since it was designed and made separate for that purpose and the results can safely be reused without needing to worry too much about it being stale. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'packages')
-rw-r--r--packages/views.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/packages/views.py b/packages/views.py
index ae31f15..20fdb39 100644
--- a/packages/views.py
+++ b/packages/views.py
@@ -20,7 +20,7 @@ import string
from main.models import Package, PackageFile
from main.models import Arch, Repo, Signoff
from main.models import MirrorUrl
-from main.utils import make_choice
+from main.utils import cache_function, make_choice
from packages.models import PackageGroup, PackageRelation
def opensearch(request):
@@ -85,6 +85,7 @@ def details(request, name='', repo='', arch=''):
return HttpResponseRedirect("/packages/?arch=%s&repo=%s&q=%s" % (
arch.lower(), repo.title(), name))
+@cache_function(300)
def get_group_information():
raw_groups = PackageGroup.objects.values_list(
'name', 'pkg__arch__name').order_by('name').annotate(