source: WAeUP_SRP/trunk/skins/waeup_utilities/ti_311_resolve.py @ 16589

Last change on this file since 16589 was 2033, checked in by joachim, 17 years ago

add course too registered_courses only for current_level

  • Property svn:keywords set to Id
File size: 1.1 KB
Line 
1## Script (Python) "findStudentsWithCourses"
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_311_resolve.py 2033 2007-07-18 13:44:13Z joachim $
11"""
12"""
13try:
14    from Products.zdb import set_trace
15except:
16    def set_trace():
17        pass
18import logging
19logger = logging.getLogger('Skins.ti_311_resolve')
20from Products.AdvancedQuery import Eq, Between, Le,In
21aq_students = context.students_catalog.evalAdvancedQuery
22
23request = context.REQUEST
24session = request.SESSION
25response = request.RESPONSE
26setheader = request.RESPONSE.setHeader
27students = context.portal_url.getPortalObject().campus.students
28#from string import Template
29def rwrite(s):
30    response.setHeader('Content-type','text/html; charset=ISO-8859-15')
31    response.write("%s<br>\n\r" % s)
32
33#logger.info('')
34
35query = Eq('review_state','courses_registered') & Eq('session','05')
36brains = aq_students(query)
37total = len(brains)
38logger.info('found %d students with session 05 and courses_registered' % total)
39count = 0
40for brain in brains:
41    rwrite('%s , %s ,%s, %s' % (brain.id,brain.jamb_reg_no,brain.matric_no,brain.name))
Note: See TracBrowser for help on using the repository browser.