Last change
on this file since 1138 was
1077,
checked in by joachim, 18 years ago
|
files for custom
|
-
Property svn:keywords set to
Id
|
File size:
768 bytes
|
Rev | Line | |
---|
[1072] | 1 | ## Script (Python) "getStudentInfo" |
---|
| 2 | ##bind container=container |
---|
| 3 | ##bind context=context |
---|
| 4 | ##bind namespace= |
---|
| 5 | ##bind script=script |
---|
| 6 | ##bind subpath=traverse_subpath |
---|
| 7 | ##parameters= |
---|
| 8 | ##title= |
---|
| 9 | ## |
---|
| 10 | # $Id: getStudentWorkflowInfo.py 1077 2006-12-18 19:44:57Z joachim $ |
---|
| 11 | """ |
---|
| 12 | return Info about the current Student |
---|
| 13 | """ |
---|
| 14 | mtool = context.portal_membership |
---|
| 15 | wf = context.portal_workflow |
---|
| 16 | member = mtool.getAuthenticatedMember() |
---|
| 17 | member_id = str(member) |
---|
| 18 | if mtool.isAnonymousUser(): |
---|
| 19 | return None |
---|
| 20 | info = {} |
---|
[1077] | 21 | if not context.isStudent(): |
---|
[1072] | 22 | return None |
---|
| 23 | student_id = member_id |
---|
| 24 | students_object = context.portal_url.getPortalObject().campus.students |
---|
| 25 | student = getattr(students_object, student_id) |
---|
| 26 | info['id'] = student_id |
---|
| 27 | #info['student'] = student |
---|
| 28 | info['url'] = student.absolute_url() |
---|
| 29 | info['review_state'] = wf.getInfoFor(student,'review_state',None) |
---|
| 30 | return info |
---|
Note: See
TracBrowser for help on using the repository browser.