Changeset 8124413


Ignore:
Timestamp:
Feb 8, 2013, 3:08:37 AM (13 years ago)
Author:
Alex Dehnert <adehnert@…>
Branches:
master, space-access, stable, stage
Children:
afc5348
Parents:
86accce
git-author:
Alex Dehnert <adehnert@…> (02/08/13 03:08:37)
git-committer:
Alex Dehnert <adehnert@…> (02/08/13 03:08:37)
Message:

Sort and limit the columns of the signatory page

File:
1 edited

Legend:

Unmodified
Added
Removed
  • asadb/groups/views.py

    rbfa60e8 r8124413  
    942942@permission_required('groups.view_signatories')
    943943def view_signatories(request, ):
    944     # TODO:
    945     # * limit which columns (roles) get displayed
    946     # This might want to wait for the generic reporting infrastructure, since
    947     # I'd imagine some of it can be reused.
    948 
    949944    the_groups = groups.models.Group.objects.all()
    950945    groups_filterset = GroupFilter(request.GET, the_groups)
     
    953948    officers = officers.filter(group__in=the_groups)
    954949    officers = officers.select_related(depth=1)
    955     roles = groups.models.OfficerRole.objects.all()
     950    role_slugs = ['president', 'treasurer', 'financial', 'reservation']
     951    roles = groups.models.OfficerRole.objects.filter(slug__in=role_slugs)
     952    roles = sorted(roles, key=lambda r: role_slugs.index(r.slug))
    956953    officers_map = collections.defaultdict(lambda: collections.defaultdict(set))
    957954    for officer in officers:
Note: See TracChangeset for help on using the changeset viewer.