Last change
on this file since 3329 was
3269,
checked in by joachim, 17 years ago
|
raise KeyError?, check if other methods are correct.
|
-
Property svn:keywords set to
Id
|
File size:
326 bytes
|
Rev | Line | |
---|
[173] | 1 | ##parameters=key=None |
---|
| 2 | # $Id: getFacultiesVoc.py 3269 2008-03-04 10:59:18Z joachim $ |
---|
| 3 | """ |
---|
| 4 | Return the faculties as an vocabulary |
---|
| 5 | |
---|
| 6 | """ |
---|
[265] | 7 | if key is None: |
---|
| 8 | res = context.portal_catalog.search({'meta_type': "Faculty"}) |
---|
| 9 | return [(d.getId,d.Title,) for d in res] |
---|
[312] | 10 | res = context.portal_catalog.search({'meta_type': "Faculty", 'id': key}) |
---|
| 11 | if res: |
---|
| 12 | return [-1].Title |
---|
[3269] | 13 | raise KeyError |
---|
Note: See
TracBrowser for help on using the repository browser.