Last change
on this file since 6502 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
|
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 1870 2007-06-08 16:13:05Z joachim $ |
---|
| 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": |
---|
[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] | 35 | return "%s" % (d_review) |
---|
| 36 | |
---|
Note: See
TracBrowser for help on using the repository browser.