Last change
on this file since 8060 was
3494,
checked in by joachim, 17 years ago
|
implement certificates_catalog
|
-
Property svn:keywords set to
Id
|
File size:
521 bytes
|
Line | |
---|
1 | ##parameters=key=None |
---|
2 | # $Id: getCertificatesVoc.py 3494 2008-05-08 09:35:54Z joachim $ |
---|
3 | """ |
---|
4 | Return the faculties as an vocabulary |
---|
5 | |
---|
6 | """ |
---|
7 | # if key is None: |
---|
8 | # res = context.portal_catalog.search({'meta_type': "Certificate"}) |
---|
9 | # return [(d.getId,d.Title,) for d in res] |
---|
10 | # res = context.portal_catalog.search({'meta_type': "Certificate", 'id': key}) |
---|
11 | # if res: |
---|
12 | # return res[0].Title |
---|
13 | if key is None: |
---|
14 | res = context.certificates_catalog() |
---|
15 | return [(d.code,d.title,) for d in res] |
---|
16 | res = context.certificates_catalog(code=key) |
---|
17 | if res: |
---|
18 | return res[0].title |
---|
19 | raise KeyError |
---|
Note: See
TracBrowser for help on using the repository browser.