Last change
on this file since 3342 was
3339,
checked in by Henrik Bettermann, 17 years ago
|
resolve ticket #507
Now we need a fix which replaces current_mode of all students by the certificate study_mode value.
|
File size:
653 bytes
|
Line | |
---|
1 | ##parameters=key=None |
---|
2 | # $Id: getCertificatesVoc.py 3254 2008-02-28 13:06:20Z joachim $ |
---|
3 | """ |
---|
4 | Return the certificates as dictionary |
---|
5 | |
---|
6 | """ |
---|
7 | |
---|
8 | try: |
---|
9 | from Products.zdb import set_trace |
---|
10 | except: |
---|
11 | def set_trace(): |
---|
12 | pass |
---|
13 | |
---|
14 | if key is None: |
---|
15 | res = context.portal_catalog.search({'meta_type': "Certificate"}) |
---|
16 | dict = {} |
---|
17 | |
---|
18 | for d in res: |
---|
19 | c = d.getObject().getContent() |
---|
20 | if not hasattr(c,'study_mode'): |
---|
21 | continue |
---|
22 | dict[d.getId] = (c.title,c.study_mode) |
---|
23 | #set_trace() |
---|
24 | return dict |
---|
25 | |
---|
26 | res = context.portal_catalog.search({'meta_type': "Certificate", 'id': key}) |
---|
27 | if res: |
---|
28 | return res[0].Title |
---|
29 | raise KeyError |
---|
Note: See
TracBrowser for help on using the repository browser.