diff options
author | Dusty Phillips <buchuki@gmail.com> | 2008-10-07 23:31:32 +0200 |
---|---|---|
committer | Dusty Phillips <buchuki@gmail.com> | 2008-10-07 23:31:32 +0200 |
commit | bccc5c0ab8396075a50294b11a35b7ed6d028bc6 (patch) | |
tree | 136dbba2db84f5bf8d56169dc2d911c1c0d7e5c2 /packages | |
parent | 51d947827419e5d61842cbd895a914076defb9c9 (diff) | |
download | archweb-bccc5c0ab8396075a50294b11a35b7ed6d028bc6.tar.gz archweb-bccc5c0ab8396075a50294b11a35b7ed6d028bc6.tar.xz |
fix sorting issue
Diffstat (limited to 'packages')
-rw-r--r-- | packages/views.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/packages/views.py b/packages/views.py index d6f23b1..3318d21 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, |