diff options
author | Dan McGee <dan@archlinux.org> | 2010-08-27 09:20:14 -0500 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2010-08-27 09:20:14 -0500 |
commit | e247e0dd8c1cd6e27be4ec12de9038cc492faf0a (patch) | |
tree | ee876a6ac0d7723e52647368e42c07c9d3a7fe9f /devel | |
parent | ecdd4ad6dae62594acefb4e8650e405871775479 (diff) |
Add table sorting to a handful of pages
Anything that it makes sense to add it to gets the treatment here. Anything
with pagination can wait as that will be tougher. We also need to deal with
odd/even formatting.
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'devel')
-rw-r--r-- | devel/views.py | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/devel/views.py b/devel/views.py index 5f4bcb94..192a4572 100644 --- a/devel/views.py +++ b/devel/views.py @@ -26,16 +26,17 @@ def index(request): '''the Developer dashboard''' inner_q = PackageRelation.objects.filter(user=request.user).values('pkgbase') flagged = Package.objects.select_related('arch', 'repo').filter(flag_date__isnull=False) - flagged = flagged.filter(pkgbase__in=inner_q) + flagged = flagged.filter(pkgbase__in=inner_q).order_by('pkgname') todopkgs = TodolistPkg.objects.select_related( 'pkg', 'pkg__arch', 'pkg__repo').filter(complete=False) - todopkgs = todopkgs.filter(pkg__pkgbase__in=inner_q) + todopkgs = todopkgs.filter(pkg__pkgbase__in=inner_q).order_by('list__name', 'pkg__pkgname') page_dict = { - 'todos': Todolist.objects.incomplete(), - 'repos': Repo.objects.all(), 'arches': Arch.objects.all(), - 'maintainers': User.objects.filter(is_active=True).order_by('last_name'), + 'todos': Todolist.objects.incomplete().order_by('-date_added'), + 'repos': Repo.objects.all(), + 'arches': Arch.objects.all(), + 'maintainers': User.objects.filter(is_active=True).order_by('first_name', 'last_name'), 'flagged' : flagged, 'todopkgs' : todopkgs, } @@ -82,7 +83,7 @@ def change_profile(request): @login_required def mirrorlist(request): - mirrors = Mirror.objects.select_related().all() + mirrors = Mirror.objects.select_related().order_by('tier', 'country') return render_to_response('devel/mirrorlist.html', RequestContext(request, {'mirror_list': mirrors})) |