Line | |
---|
1 | ## Script (Python) "getCoursesCertificatesInfo" |
---|
2 | ##bind container=container |
---|
3 | ##bind context=context |
---|
4 | ##bind namespace= |
---|
5 | ##bind script=script |
---|
6 | ##bind subpath=traverse_subpath |
---|
7 | ##parameters=student=None |
---|
8 | ##title= |
---|
9 | ## |
---|
10 | # $Id: getCoursesCertificatesInfo.py 1988 2007-07-05 11:14:12Z joachim $ |
---|
11 | """ |
---|
12 | return Info about the Faculties |
---|
13 | """ |
---|
14 | request = context.REQUEST |
---|
15 | |
---|
16 | wf = context.portal_workflow |
---|
17 | |
---|
18 | info = {} |
---|
19 | info['action'] = "%s/faculty_view" % context.absolute_url() |
---|
20 | info['choosen_ids'] = request.get('ids',[]) |
---|
21 | info['doc'] = context.getContent() |
---|
22 | # brain = context.portal_catalog(meta_type="Department", id = context.getId())[-1] |
---|
23 | # cp = brain.getPath() |
---|
24 | cp = request.get('PATH_INFO') |
---|
25 | info['container_path'] = cp |
---|
26 | res = context.portal_catalog(container_path="%s/certificates" % cp) |
---|
27 | items = [] |
---|
28 | for r in res: |
---|
29 | row = {} |
---|
30 | ro = r.getObject() |
---|
31 | rd = ro.getContent() |
---|
32 | row['id'] = r.getId |
---|
33 | row['title'] = rd.Title() |
---|
34 | row['url'] = ro.absolute_url() |
---|
35 | items.append(row) |
---|
36 | info['certificates'] = items |
---|
37 | return info |
---|
38 | |
---|
Note: See
TracBrowser for help on using the repository browser.