source: WAeUP_SRP/trunk/skins/waeup_utilities/removeResults.py @ 1388

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

siehe Email

File size: 1.4 KB
RevLine 
[1253]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
[1388]16response = request.RESPONSE
17
18def rwrite(s):
19    response.setHeader('Content-type','text/html; charset=ISO-8859-15')
20    #response.setHeader('Content-length','%d' % (len(s)))
21    #response.setStatus('OK')
22    response.write(s)
23
[1253]24wftool = context.portal_workflow
25mtool = context.portal_membership
26member = mtool.getAuthenticatedMember()
27roles = member.getRolesInContext(context)
28rcat = context.results_import
[1388]29scat = context.students_catalog
[1253]30#from Products.zdb import set_trace;set_trace()
31if str(member) not in ('admin','joachim'):
[1388]32    return
33rwrite("start <br />")
[1253]34for m in rcat.uniqueValuesFor('matric_no'):
[1388]35    #if m.startswith('ART'):
36    res_r = rcat(matric_no = m)
37    res_s = scat(matric_no = m)
38    if res_s and res_s[0].course == 'BARTTHR' and res_s[0].level =="500":
[1253]39        to_del = []
[1388]40        for r in res_r:
[1253]41            to_del.append(r.key)
[1388]42           
43        #zum Testen auskommentiert   
44        #for uid in to_del:
45            #rcat.deleteRecord(uid)
46           
47        rwrite(m+" "+res_s[0].course+" "+res_s[0].level + " " + str(len(to_del)) +"<br />")
48rwrite("<br />\n Done" )       
Note: See TracBrowser for help on using the repository browser.