[3718] | 1 | ## Script (Python) "getPastoralReportInfo"
|
---|
| 2 | ##bind container=container
|
---|
| 3 | ##bind context=context
|
---|
| 4 | ##bind namespace=
|
---|
| 5 | ##bind script=script
|
---|
| 6 | ##bind subpath=traverse_subpath
|
---|
| 7 | ##parameters=student=None
|
---|
| 8 | ##title=
|
---|
| 9 | ##
|
---|
| 10 | # $Id: getPastoralReportInfo.py 2760 2007-11-26 07:39:15Z henrik $
|
---|
| 11 | """
|
---|
| 12 | return Info about the Studylevel
|
---|
| 13 | try:
|
---|
| 14 | from Products.zdb import set_trace
|
---|
| 15 | except:
|
---|
| 16 | def set_trace():
|
---|
| 17 | pass
|
---|
| 18 | """
|
---|
| 19 |
|
---|
| 20 | info = context.waeup_tool.getAccessInfo(context)
|
---|
| 21 | student_id = info['student_id']
|
---|
| 22 | if student_id is None:
|
---|
| 23 | return None
|
---|
| 24 |
|
---|
| 25 | mtool = context.portal_membership
|
---|
| 26 | member = mtool.getAuthenticatedMember()
|
---|
| 27 | member_id = str(member)
|
---|
| 28 |
|
---|
| 29 | course_results = context.course_results
|
---|
| 30 | request = context.REQUEST
|
---|
| 31 | response = request.RESPONSE
|
---|
| 32 | import logging
|
---|
| 33 | logger = logging.getLogger('Skins.getPastoralReportInfo')
|
---|
| 34 |
|
---|
| 35 | level_doc = info['level_doc'] = context.aq_parent.getContent()
|
---|
| 36 | doc = info['doc'] = context.getContent()
|
---|
| 37 | info['session'] = context.portal_vocabularies.sessions.get(level_doc.session)
|
---|
| 38 | info['level'] = context.portal_vocabularies.student_levels.get(context.aq_parent.getId())
|
---|
| 39 | info['term'] = context.portal_vocabularies.terms.get(context.getId())
|
---|
| 40 | info['is_so'] = is_so = info['is_sectionofficer']
|
---|
| 41 | #info['is_student'] = is_student = context.isStudent()
|
---|
| 42 | #info['is_ca'] = is_ca = context.isCourseAdviser()
|
---|
| 43 | #info['student'] = student = context.students_catalog(id=student_id)[0]
|
---|
| 44 | #info['student'] = student = context.students_catalog.getRecordByKey(student_id)
|
---|
| 45 |
|
---|
| 46 | students_object = context.portal_url.getPortalObject().campus.students
|
---|
| 47 | student = getattr(students_object, student_id)
|
---|
[3804] | 48 | #info['app'] = student.application
|
---|
| 49 | #info['app_doc'] = student.application.getContent()
|
---|
[3718] | 50 |
|
---|
| 51 | return info |
---|