From bccc5c0ab8396075a50294b11a35b7ed6d028bc6 Mon Sep 17 00:00:00 2001 From: Dusty Phillips Date: Tue, 7 Oct 2008 17:31:32 -0400 Subject: fix sorting issue --- packages/views.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'packages') diff --git a/packages/views.py b/packages/views.py index d6f23b15..3318d210 100644 --- a/packages/views.py +++ b/packages/views.py @@ -134,12 +134,15 @@ def search(request, page=None): if len(packages) == 1: return HttpResponseRedirect(packages[0].get_absolute_url()) - sort = request.GET.get('sort', '') - if sort in request.GET: - packages = packages.order_by(sort, 'repo', 'arch', 'pkgname') + if 'sort' in request.GET: + print 'sorting' + packages = packages.order_by(request.GET['sort'], 'repo', 'arch', 'pkgname') else: + print 'not sorting' packages = packages.order_by('repo', 'arch', '-last_update', 'pkgname') + print packages + return list_detail.object_list(request, packages, template_name="packages/search.html", page=page, -- cgit v1.2.3-54-g00ecf