## Script (Python) "ti_151_resolve"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=
##title=
##
# $Id: ti_165_resolve.py 1660 2007-03-29 17:11:02Z joachim $
"""
resolve ticket #151
"""
try:
from Products.zdb import set_trace
except:
def set_trace():
pass
import logging
#>>>>>>>>>>>>>>>><
logger = logging.getLogger('Skins.ti_165_resolve')
#logger.info('already done on 26.3.07 by joachim')
#return
#<<<<<<<<<<<<<<<<<
request = context.REQUEST
session = request.SESSION
response = request.RESPONSE
setheader = request.RESPONSE.setHeader
students = context.portal_url.getPortalObject().campus.students
#from string import Template
def rwrite(s):
response.setHeader('Content-type','text/html; charset=ISO-8859-15')
response.write("%s
\n\r" % s)
def getObject(outer,object):
if outer.hasObject(object):
return getattr(outer,object)
return None
try:
from Products.AdvancedQuery import Eq, Between, Le,In
aq_students = context.students_catalog.evalAdvancedQuery
except:
evalAdvancedQuery = None
students_cat = context.students_catalog
pumeresults = context.portal_pumeresults
de_students = students_cat(entry_mode = 'DE')
found = 0
not_found = 0
for des in de_students:
if not des.jamb_reg_no.startswith('6'):
continue
pres = pumeresults(jamb_reg_no = des.jamb_reg_no)
if not pres:
rwrite('>>>>>>>> %s with jamb_reg_no %s not found in pumeresults' % (des.id,des.jamb_reg_no))
not_found += 1
continue
found += 1
rwrite('%s with jamb_reg_no %s found in pumeresults' % (des.id,des.jamb_reg_no))
rwrite('%d found in pumeresults
%d not found in pumeresults
total in portal_pumeresults %d
'
% (found,not_found,len(pumeresults())))