Changeset b90b977
- Timestamp:
- Mar 23, 2012, 1:28:26 AM (14 years ago)
- 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)
- File:
-
- 1 edited
-
asadb/groups/format_groups.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
asadb/groups/format_groups.py
rf57cf3c rb90b977 16 16 17 17 18 Qs emiactive= Q(group_status__slug__in=('active', 'suspended', ))18 Qsa = Q(group_status__slug__in=('active', 'suspended', )) 19 19 functions = { 20 20 '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', ), 23 23 }, 24 24 '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=""), 27 27 }, 28 28 'asa-official' : { … … 31 31 }, 32 32 'emails-only' : { 33 'format' : '%( OFFICER_EMAIL)s',34 'predicate' : Qs emiactive,33 'format' : '%(officer_email)s', 34 'predicate' : Qsa, 35 35 }, 36 36 } … … 39 39 format = functions[mode]['format'] 40 40 predicate = functions[mode]['predicate'] 41 gs = groups.models.Group.objects.filter( Qsemiactive &predicate)41 gs = groups.models.Group.objects.filter(predicate) 42 42 for group in gs: 43 43 print format % {
Note: See TracChangeset
for help on using the changeset viewer.