source:
WAeUP_SRP/base/skins/waeup_academics/getDepartmentsVoc.py
@
3281
Last change on this file since 3281 was 3254, checked in by , 17 years ago | |
---|---|
|
|
File size: 338 bytes |
Line | |
---|---|
1 | ##parameters=key=None |
2 | # $Id: getDepartmentsVoc.py 3254 2008-02-28 13:06:20Z joachim $ |
3 | """ |
4 | Return the faculties as an vocabulary |
5 | |
6 | """ |
7 | if key is None: |
8 | res = context.portal_catalog.search({'meta_type': "Department"}) |
9 | return [(d.getId(),d.Title,) for d in res] |
10 | res = context.portal_catalog.search({'meta_type': "Department", 'id': key}) |
11 | if res: |
12 | return res[-1].Title |
13 | |
14 | raise KeyError |
15 |
Note: See TracBrowser for help on using the repository browser.