summaryrefslogtreecommitdiff
path: root/public/views.py
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2010-02-04 20:44:46 -0600
committerDan McGee <dan@archlinux.org>2010-02-05 17:03:35 -0600
commitb2f33457f646c9340059d4ab02b5b7280dbeff9d (patch)
treec0957a7592656144bb2f31342f455812f52036a3 /public/views.py
parent6fe8aec0abdfe284439e9d3adda85da8e5c3825b (diff)
Make recent updates group multiple architectures
It isn't the most elegant operation in the world, but attempt to only show one line per package, grouping by architecture if multiple were updated in the same go. This makes the recent packages view a bit more useful as a heads up view. Implements FS#17304. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'public/views.py')
-rw-r--r--public/views.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/public/views.py b/public/views.py
index d4a1c80c..560f9bb0 100644
--- a/public/views.py
+++ b/public/views.py
@@ -1,6 +1,8 @@
-from django.contrib.auth.models import User
from archweb.main.models import AltForum, Arch, Donor, MirrorUrl, News
from archweb.main.models import Package, Repo, ExternalProject
+from . import utils
+
+from django.contrib.auth.models import User
from django.db.models import Q
from django.shortcuts import render_to_response
from django.template import RequestContext
@@ -8,10 +10,10 @@ from django.views.generic import list_detail
def index(request):
+ pkgs = utils.get_recent_updates()
context = {
'news_updates': News.objects.order_by('-postdate', '-id')[:10],
- 'pkg_updates': Package.objects.select_related('arch', 'repo').order_by('-last_update')[:15],
- 'repos': Repo.objects.all()
+ 'pkg_updates': pkgs,
}
return render_to_response('public/index.html', context,
context_instance=RequestContext(request))