Last change
on this file since 3106 was
2728,
checked in by joachim, 17 years ago
|
rename methods
|
-
Property svn:keywords set to
Id
|
File size:
359 bytes
|
Rev | Line | |
---|
[173] | 1 | ##parameters=key=None |
---|
| 2 | # $Id: getDepartmentsVoc.py 2728 2007-11-21 14:13:36Z joachim $ |
---|
| 3 | """ |
---|
| 4 | Return the faculties as an vocabulary |
---|
| 5 | |
---|
| 6 | """ |
---|
[256] | 7 | if key is None: |
---|
[265] | 8 | res = context.portal_catalog.search({'meta_type': "Department"}) |
---|
[389] | 9 | return [(d.getId(),d.Title,) for d in res] |
---|
[312] | 10 | res = context.portal_catalog.search({'meta_type': "Department", 'id': key}) |
---|
| 11 | if res: |
---|
| 12 | return res[-1].Title |
---|
[313] | 13 | return "unknown Department %s" % key |
---|
[312] | 14 | |
---|
Note: See
TracBrowser for help on using the repository browser.