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 | """ |
---|
12 | list Students for ClearanceOfficers |
---|
13 | """ |
---|
14 | |
---|
15 | request = REQUEST |
---|
16 | response = request.RESPONSE |
---|
17 | |
---|
18 | def 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 | |
---|
24 | res_to_del = ('ART0206832', |
---|
25 | 'ART0206156', |
---|
26 | 'ART0206812', |
---|
27 | 'ART0206841', |
---|
28 | 'ART0206813', |
---|
29 | 'ART0206816', |
---|
30 | 'ART0206614', |
---|
31 | 'ART0206817', |
---|
32 | 'ART0206830', |
---|
33 | 'ART0205970', |
---|
34 | 'ART0206158', |
---|
35 | 'ART0206811', |
---|
36 | 'ART0206815', |
---|
37 | 'ART0301351', |
---|
38 | 'ART0301319', |
---|
39 | 'ART0301310', |
---|
40 | 'ART0308340', |
---|
41 | 'ART0206157', |
---|
42 | 'ART0206833', |
---|
43 | 'ART0206831', |
---|
44 | 'ART0206964', |
---|
45 | 'ART0206838', |
---|
46 | 'ART0206821', |
---|
47 | 'ART0206844', |
---|
48 | 'ART0206828', |
---|
49 | 'ART0206820', |
---|
50 | 'ART0206842', |
---|
51 | 'ART0206834', |
---|
52 | 'ART0206839', |
---|
53 | 'ART0206819', |
---|
54 | 'ART0206825', |
---|
55 | 'ART0206818', |
---|
56 | 'ART0206840', |
---|
57 | 'ART0206836', |
---|
58 | 'ART0206829') |
---|
59 | |
---|
60 | |
---|
61 | wftool = context.portal_workflow |
---|
62 | mtool = context.portal_membership |
---|
63 | member = mtool.getAuthenticatedMember() |
---|
64 | roles = member.getRolesInContext(context) |
---|
65 | rcat = context.results_import |
---|
66 | scat = context.students_catalog |
---|
67 | #from Products.zdb import set_trace;set_trace() |
---|
68 | if str(member) not in ('admin','joachim'): |
---|
69 | return |
---|
70 | rwrite("start") |
---|
71 | #for m in rcat.uniqueValuesFor('matric_no'): |
---|
72 | for m in res_to_del: |
---|
73 | #if m.startswith('ART'): |
---|
74 | res_r = rcat(matric_no = m) |
---|
75 | #res_s = scat(matric_no = m) |
---|
76 | #if res_s and res_s[0].course == 'BARTTHR' and res_s[0].level =="500": |
---|
77 | to_del = [] |
---|
78 | for r in res_r: |
---|
79 | to_del.append(r.key) |
---|
80 | rwrite(m+" "+r.Level +" " + r.CosCode + "<br />") |
---|
81 | for uid in to_del: |
---|
82 | rcat.deleteRecord(uid) |
---|
83 | rwrite("Done") |
---|
84 | |
---|
Note: See
TracBrowser for help on using the repository browser.