# HG changeset patch # User casties # Date 1407927888 -7200 # Node ID 738129610f360cf7642198891393755cffef657d # Parent e7b3c7ab9eb536dfc1bdbd0f6948f2afeaa056d8 getMemberList gets status filter parameter. 164: Staff Sortierung Predoc und Postdocs Task-Url: https://it-dev.mpiwg-berlin.mpg.de/tracs/webpage/ticket/164 diff -r e7b3c7ab9eb5 -r 738129610f36 MPIWGStaff.py --- a/MPIWGStaff.py Wed Aug 13 12:25:34 2014 +0200 +++ b/MPIWGStaff.py Wed Aug 13 13:04:48 2014 +0200 @@ -100,7 +100,7 @@ def getMemberList(self, department=None, sortBy='last_name', onlyCurrent=False, arrivedWithin=None, - onlyPublished=True, onlyWithEmail=True, onlyScholar=True, limit=0): + onlyPublished=True, onlyWithEmail=True, onlyScholar=True, status=None, limit=0): """Return the list of members. Returns a list of MPIWGStaffMember objects. @@ -128,6 +128,10 @@ if arrivedWithin is not None: wheres.append("date_from > CURRENT_DATE - interval %s") args.append(arrivedWithin) + + if status is not None: + wheres.append("status ilike %s") + args.append('%%%s%%'%status) # assemble query query = "SELECT * FROM personal_www_list"