## Script (Python) "getPastoralReportInfo" ##bind container=container ##bind context=context ##bind namespace= ##bind script=script ##bind subpath=traverse_subpath ##parameters=student=None ##title= ## # $Id: getPastoralReportInfo.py 2760 2007-11-26 07:39:15Z henrik $ """ return Info about the Studylevel try: from Products.zdb import set_trace except: def set_trace(): pass """ info = context.waeup_tool.getAccessInfo(context) student_id = info['student_id'] if student_id is None: return None mtool = context.portal_membership member = mtool.getAuthenticatedMember() member_id = str(member) course_results = context.course_results request = context.REQUEST response = request.RESPONSE import logging logger = logging.getLogger('Skins.getPastoralReportInfo') level_doc = info['level_doc'] = context.aq_parent.getContent() doc = info['doc'] = context.getContent() info['session'] = context.portal_vocabularies.sessions.get(level_doc.session) info['level'] = context.portal_vocabularies.student_levels.get(context.aq_parent.getId()) info['term'] = context.portal_vocabularies.terms.get(context.getId()) info['is_so'] = is_so = info['is_sectionofficer'] #info['is_student'] = is_student = context.isStudent() #info['is_ca'] = is_ca = context.isCourseAdviser() #info['student'] = student = context.students_catalog(id=student_id)[0] #info['student'] = student = context.students_catalog.getRecordByKey(student_id) return info