Last change
on this file since 1819 was
1819,
checked in by Henrik Bettermann, 17 years ago
|
ticket #223 (in custom)
|
-
Property svn:keywords set to
Id
|
File size:
896 bytes
|
Rev | Line | |
---|
[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 1819 2007-05-24 13:28:31Z henrik $ |
---|
| 11 | """ |
---|
| 12 | return Info about the current Student |
---|
| 13 | """ |
---|
| 14 | ptool = context.portal_proxies |
---|
| 15 | wf_vars = ['review_state'] |
---|
[1819] | 16 | try: |
---|
| 17 | docid = context.getDocid() |
---|
| 18 | except: |
---|
| 19 | return '' |
---|
[1187] | 20 | if docid: |
---|
| 21 | proxies_info = ptool.getProxyInfosFromDocid(docid, |
---|
| 22 | workflow_vars=wf_vars) |
---|
| 23 | d_review = proxies_info[0]['review_state'] |
---|
[1191] | 24 | else: |
---|
| 25 | d_review = '' |
---|
[1187] | 26 | if context.portal_type != "Student": |
---|
| 27 | student_id = context.getStudentId() |
---|
[1355] | 28 | if student_id: |
---|
| 29 | res = context.portal_catalog(id = student_id,portal_type='Student') |
---|
| 30 | if res: |
---|
| 31 | s_review = res[-1].review_state |
---|
| 32 | return "%s / %s" % (s_review,d_review) |
---|
[1187] | 33 | return "%s" % (d_review) |
---|
| 34 | |
---|
Note: See
TracBrowser for help on using the repository browser.