Last change
on this file since 3337 was
3337,
checked in by Henrik Bettermann, 17 years ago
|
ticket #507 (not yet finished)
Upload.py: fix security declaration
|
File size:
635 bytes
|
Line | |
---|
1 | ##parameters=key=None |
---|
2 | # $Id: getCertificatesVoc.py 3254 2008-02-28 13:06:20Z joachim $ |
---|
3 | """ |
---|
4 | Return the certificates as list |
---|
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 | l = [] |
---|
17 | #set_trace() |
---|
18 | for d in res: |
---|
19 | c = d.getObject().getContent() |
---|
20 | if not hasattr(c,'study_mode'): |
---|
21 | continue |
---|
22 | l.append((d.getId,c.title,c.study_mode)) |
---|
23 | return l |
---|
24 | |
---|
25 | res = context.portal_catalog.search({'meta_type': "Certificate", 'id': key}) |
---|
26 | if res: |
---|
27 | return res[0].Title |
---|
28 | raise KeyError |
---|
Note: See
TracBrowser for help on using the repository browser.