diff options
Diffstat (limited to 'packages/views.py')
-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 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, |