source: WAeUP_SRP/trunk/skins/waeup_default/getReviewInfo.py @ 15344

Last change on this file since 15344 was 1870, checked in by joachim, 17 years ago

get student review_state from students_catalog

  • Property svn:keywords set to Id
File size: 973 bytes
RevLine 
[1191]1## Script (Python) "getReviewInfo"
[1187]2##bind container=container
3##bind context=context
4##bind namespace=
5##bind script=script
6##bind subpath=traverse_subpath
7##parameters=student=None, with_items=None
8##title=
9##
10# $Id: getReviewInfo.py 1870 2007-06-08 16:13:05Z joachim $
11"""
12return Info about the current Student
13"""
14ptool = context.portal_proxies
15wf_vars = ['review_state']
[1819]16try:
17    docid = context.getDocid()
18except:
19    return ''
[1187]20if docid:
21    proxies_info = ptool.getProxyInfosFromDocid(docid,
22                                                workflow_vars=wf_vars)
23    d_review = proxies_info[0]['review_state']
[1191]24else:
25    d_review = ''
[1187]26if context.portal_type != "Student":
[1870]27    s_review = context.getStudentReviewState()
28    if s_review:
29        return "%s / %s" % (s_review,d_review)
30    # student_id = context.getStudentId()
31    # if student_id:
32    #     res = context.portal_catalog(id = student_id,portal_type='Student')
33    #     if res:
34    #         return "%s / %s" % (s_review,d_review)
[1187]35return "%s" % (d_review)
36
Note: See TracBrowser for help on using the repository browser.