source: WAeUP_SRP/trunk/skins/waeup_utilities/ti_339_resolve.py @ 8794

Last change on this file since 8794 was 2179, checked in by Henrik Bettermann, 17 years ago

see ticket #342

  • Property svn:keywords set to Id
File size: 1.5 KB
Line 
1## Script (Python) "ti_339_resolve"
2##bind container=container
3##bind context=context
4##bind namespace=
5##bind script=script
6##bind subpath=traverse_subpath
7##parameters=
8##title=
9##
10# $Id: ti_339_resolve.py 2179 2007-09-05 14:03:29Z henrik $
11"""
12"""
13try:
14    from Products.zdb import set_trace
15except:
16    def set_trace():
17        pass
18       
19mtool = context.portal_membership
20member = mtool.getAuthenticatedMember()
21if str(member) not in ('admin','joachim'):
22    return
23   
24           
25import logging
26import DateTime
27logger = logging.getLogger('Skins.ti_339_resolve')
28from Products.AdvancedQuery import Eq, Between, Le,In
29applicants = context.applicants_catalog
30
31request = context.REQUEST
32session = request.SESSION
33response = request.RESPONSE
34setheader = request.RESPONSE.setHeader
35def rwrite(s):
36    response.setHeader('Content-type','text/html; charset=ISO-8859-15')
37    response.write("%s<br>\n\r" % s)
38
39#logger.info('')
40
41brains = applicants()
42total = len(brains)
43course = "BARTMAS"
44edited = 0
45for brain in brains:
46    if brain.course1 == course:
47        data = {}
48        data['reg_no'] = brain.reg_no
49        data['screening_date'] = DateTime.DateTime('2007/09/21')
50        applicants.modifyRecord(**data)
51        edited += 1
52        rwrite('%d: %s,%s,%s,%s' % (edited,
53                                    brain.reg_no,
54                                    brain.course1,
55                                    brain.status,
56                                    brain.email)
57              )
58logger.info("edited %d %s students" % (edited,course))
Note: See TracBrowser for help on using the repository browser.