## Script (Python) "getStudentReviewState" ##bind container=container ##bind context=context ##bind namespace= ##bind script=script ##bind subpath=traverse_subpath ##parameters=student_id=None ##title= ## # $Id: getStudentReviewState.py 1845 2007-06-02 11:01:49Z joachim $ """ return the review_state of the Student """ from Products.AdvancedQuery import Eq, Between, Le,In try: aq_portal = context.portal_catalog.evalAdvancedQuery except: aq_portal = context.portal_catalog_real.evalAdvancedQuery if student_id is None: student_id = context.getStudentId() query = Eq('id',student_id) res = aq_portal(query) if not res: return None return res[0].review_state