From 1b826f3e12b66d9e2d3a90b1dddf5170ab48dc12 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Fri, 3 Dec 2010 19:38:50 -0600 Subject: Display flag date in package search and allow sorting This exposes something we added a while back, and has been shown elsewhere, but will now be available for everyone to see. Also change the default search order to just be by pkgname; we don't need to do a multi-column search by default. Signed-off-by: Dan McGee --- packages/views.py | 4 ++-- templates/packages/search.html | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/views.py b/packages/views.py index 40e8a08..283f9ce 100644 --- a/packages/views.py +++ b/packages/views.py @@ -199,7 +199,7 @@ def search(request, page=None): if packages.count() == 1: return redirect(packages[0]) - allowed_sort = ["arch", "repo", "pkgname", "last_update"] + allowed_sort = ["arch", "repo", "pkgname", "last_update", "flag_date"] allowed_sort += ["-" + s for s in allowed_sort] sort = request.GET.get('sort', None) # TODO: sorting by multiple fields makes using a DB index much harder @@ -208,7 +208,7 @@ def search(request, page=None): request.GET['sort'], 'repo', 'arch', 'pkgname') page_dict['sort'] = sort else: - packages = packages.order_by('repo', 'arch', '-last_update', 'pkgname') + packages = packages.order_by('pkgname') return list_detail.object_list(request, packages, template_name="packages/search.html", diff --git a/templates/packages/search.html b/templates/packages/search.html index c3f70fa..4a779aa 100644 --- a/templates/packages/search.html +++ b/templates/packages/search.html @@ -84,6 +84,8 @@ Description Last Updated + Flag Date @@ -103,6 +105,7 @@ {% endif %} {{ pkg.pkgdesc }} {{ pkg.last_update|date }} + {{ pkg.flag_date|date }} {% endfor %} -- cgit v1.2.3-24-g4f1b