Mercurial > hg > MPIWGWeb
diff MPIWGStaff.py @ 175:7d85ebe92ecf
getMemberList gets arrivedWithin parameter.
author | casties |
---|---|
date | Tue, 11 Jun 2013 11:29:56 +0200 |
parents | 47392bf3fcba |
children | a8d5ba6729f3 |
line wrap: on
line diff
--- a/MPIWGStaff.py Mon Jun 10 17:59:39 2013 +0200 +++ b/MPIWGStaff.py Tue Jun 11 11:29:56 2013 +0200 @@ -134,7 +134,7 @@ return len(res) > 0 - def getMemberList(self, department=None, sortBy='last_name', onlyCurrent=False, limit=0): + def getMemberList(self, department=None, sortBy='last_name', onlyCurrent=False, arrivedWithin=None, limit=0): """Return the list of members. Returns a list of MPIWGStaffMember objects. @@ -150,6 +150,10 @@ if onlyCurrent: query += " and date_from < CURRENT_DATE" + if arrivedWithin is not None: + query += " and date_from > CURRENT_DATE - interval %s" + args.append(arrivedWithin) + if sortBy == 'last_name': query += " order by lower(last_name)" elif sortBy == 'date_from':