source: WAeUP_SRP/branches/srpp_on_branch/skins/waeup_utilities/removeResults.py @ 7940

Last change on this file since 7940 was 1253, checked in by Henrik Bettermann, 18 years ago

moved tool scripts to waeup_utilities

File size: 902 bytes
Line 
1## Script (Python) "search_pins"
2##bind container=container
3##bind context=context
4##bind namespace=
5##bind script=script
6##bind subpath=traverse_subpath
7##parameters=REQUEST
8##title=
9##
10# $Id: removeResults.py 1216 2007-01-06 17:40:50Z joachim $
11"""
12list Students for ClearanceOfficers
13"""
14
15request = REQUEST
16wftool = context.portal_workflow
17mtool = context.portal_membership
18member = mtool.getAuthenticatedMember()
19roles = member.getRolesInContext(context)
20rcat = context.results_import
21#from Products.zdb import set_trace;set_trace()
22if str(member) not in ('admin','joachim'):
23    return
24count = 0
25for m in rcat.uniqueValuesFor('matric_no'):
26    if m.startswith('ENG'):
27        res = rcat(matric_no = m)
28        to_del = []
29        for r in res:
30            to_del.append(r.key)
31        for uid in to_del:
32            rcat.deleteRecord(uid)
33        count += len(to_del)
34return "%d deleted" % count
Note: See TracBrowser for help on using the repository browser.