diff options
author | Luke Shumaker <LukeShu@sbcglobal.net> | 2012-11-14 22:44:27 -0500 |
---|---|---|
committer | Luke Shumaker <LukeShu@sbcglobal.net> | 2012-11-14 22:44:27 -0500 |
commit | 64f6dd9cb41ddbc84376549f558ed7d52d9e600a (patch) | |
tree | 81f31f1ceb5fc6e4d94508d273003996e036191c /public | |
parent | bc432a1ff0e69bf45c5f3b97077a13952611196d (diff) | |
parent | b2b5c1a064d5d3c33f4c4fc119bd67cf9ca1b7ba (diff) |
Merge tag 'release_2012-01-11'
Pkgbase view in todos, other changes related to caching
Conflicts:
public/views.py
Diffstat (limited to 'public')
-rw-r--r-- | public/utils.py | 2 | ||||
-rw-r--r-- | public/views.py | 9 |
2 files changed, 9 insertions, 2 deletions
diff --git a/public/utils.py b/public/utils.py index 6566b8c4..a40c9b53 100644 --- a/public/utils.py +++ b/public/utils.py @@ -49,7 +49,7 @@ class RecentUpdate(object): if package.arch not in arches and not arches.add(package.arch): yield PackageStandin(package) -@cache_function(300) +@cache_function(62) def get_recent_updates(number=15): # This is a bit of magic. We are going to show 15 on the front page, but we # want to try and eliminate cross-architecture wasted space. Pull enough diff --git a/public/views.py b/public/views.py index af46e343..493c45f6 100644 --- a/public/views.py +++ b/public/views.py @@ -2,6 +2,7 @@ from django.conf import settings from django.contrib.auth.models import User from django.http import Http404 from django.shortcuts import redirect +from django.views.decorators.cache import cache_control from django.views.generic import list_detail from django.views.generic.simple import direct_to_template @@ -9,8 +10,9 @@ from devel.models import MasterKey from main.models import Arch, Repo, Donor from mirrors.models import MirrorUrl from news.models import News -from utils import get_recent_updates +from .utils import get_recent_updates +@cache_control(max_age=300) def index(request): pkgs = get_recent_updates() context = { @@ -30,6 +32,7 @@ USER_LISTS = { }, } +@cache_control(max_age=300) def userlist(request, user_type='hackers'): users = User.objects.order_by( 'username').select_related('userprofile') @@ -45,15 +48,18 @@ def userlist(request, user_type='hackers'): context['users'] = users return direct_to_template(request, 'public/userlist.html', context) +@cache_control(max_age=300) def donate(request): context = { 'donors': Donor.objects.filter(visible=True).order_by('name'), } return direct_to_template(request, 'public/donate.html', context) +@cache_control(max_age=300) def download(request): return redirect('//wiki.parabolagnulinux.org/get', permanent=True) +@cache_control(max_age=300) def feeds(request): context = { 'arches': Arch.objects.all(), @@ -61,6 +67,7 @@ def feeds(request): } return direct_to_template(request, 'public/feeds.html', context) +@cache_control(max_age=300) def keys(request): context = { 'keys': MasterKey.objects.select_related('owner', 'revoker', |