Last change
on this file since 3746 was
1870,
checked in by joachim, 18 years ago
|
get student review_state from students_catalog
|
-
Property svn:keywords set to
Id
|
File size:
760 bytes
|
Line | |
---|
1 | ## Script (Python) "getStudentReviewState" |
---|
2 | ##bind container=container |
---|
3 | ##bind context=context |
---|
4 | ##bind namespace= |
---|
5 | ##bind script=script |
---|
6 | ##bind subpath=traverse_subpath |
---|
7 | ##parameters=student_id=None |
---|
8 | ##title= |
---|
9 | ## |
---|
10 | # $Id: getStudentReviewState.py 1870 2007-06-08 16:13:05Z joachim $ |
---|
11 | """ |
---|
12 | return the review_state of the Student |
---|
13 | """ |
---|
14 | try: |
---|
15 | from Products.zdb import set_trace |
---|
16 | except: |
---|
17 | def set_trace(): |
---|
18 | pass |
---|
19 | # from Products.AdvancedQuery import Eq, Between, Le,In |
---|
20 | # try: |
---|
21 | # aq_portal = context.portal_catalog.evalAdvancedQuery |
---|
22 | # except: |
---|
23 | # aq_portal = context.portal_catalog_real.evalAdvancedQuery |
---|
24 | if student_id is None: |
---|
25 | student_id = context.getStudentId() |
---|
26 | #query = Eq('id',student_id) |
---|
27 | #res = aq_portal(query) |
---|
28 | res = context.students_catalog(id = student_id) |
---|
29 | if not res: |
---|
30 | return None |
---|
31 | return res[0].review_state |
---|
Note: See
TracBrowser for help on using the repository browser.