Changeset b90b977


Ignore:
Timestamp:
Mar 23, 2012, 1:28:26 AM (14 years ago)
Author:
ASA Group Database <asa-db@…>
Branches:
master, space-access, stable, stage
Children:
e9af979
Parents:
f57cf3c
git-author:
Alex Dehnert <adehnert@…> (03/23/12 01:28:26)
git-committer:
ASA Group Database <asa-db@…> (03/23/12 01:28:26)
Message:

Fixes to groups/format_groups.py to make it work

File:
1 edited

Legend:

Unmodified
Added
Removed
  • asadb/groups/format_groups.py

    rf57cf3c rb90b977  
    1616
    1717
    18 Qsemiactive = Q(group_status__slug__in=('active', 'suspended', ))
     18Qsa = Q(group_status__slug__in=('active', 'suspended', ))
    1919functions = {
    2020    'finboard' : {
    21         'format' : "%(STUDENT_GROUP_NAME)s;%(OFFICER_EMAIL)s",
    22         'predicate' : Q(group_funding__slug='undergraduate', group_class__slug='mit-funded', ),
     21        'format' : "%(name)s;%(officer_email)s",
     22        'predicate' : Qsa & Q(group_funding__slug='undergrad', group_class__slug='mit-funded', ),
    2323    },
    2424    'nolist' : {
    25         'format' : "%(STUDENT_GROUP_NAME)s <%(OFFICER_EMAIL)s>",
    26         'predicate' : ~Q(officer_email=""),
     25        'format' : "%(name)s <%(officer_email)s>",
     26        'predicate' : Qsa & Q(officer_email=""),
    2727    },
    2828    'asa-official' : {
     
    3131    },
    3232    'emails-only' : {
    33         'format' : '%(OFFICER_EMAIL)s',
    34         'predicate' : Qsemiactive,
     33        'format' : '%(officer_email)s',
     34        'predicate' : Qsa,
    3535    },
    3636}
     
    3939    format = functions[mode]['format']
    4040    predicate = functions[mode]['predicate']
    41     gs = groups.models.Group.objects.filter(Qsemiactive & predicate)
     41    gs = groups.models.Group.objects.filter(predicate)
    4242    for group in gs:
    4343        print format % {
Note: See TracChangeset for help on using the changeset viewer.