summaryrefslogtreecommitdiff
path: root/packages/views.py
diff options
context:
space:
mode:
authorDusty Phillips <buchuki@gmail.com>2008-10-07 17:31:32 -0400
committerDusty Phillips <buchuki@gmail.com>2008-10-07 17:31:32 -0400
commitbccc5c0ab8396075a50294b11a35b7ed6d028bc6 (patch)
tree136dbba2db84f5bf8d56169dc2d911c1c0d7e5c2 /packages/views.py
parent51d947827419e5d61842cbd895a914076defb9c9 (diff)
fix sorting issue
Diffstat (limited to 'packages/views.py')
-rw-r--r--packages/views.py9
1 files changed, 6 insertions, 3 deletions
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,