Last change
on this file since 2079 was
182,
checked in by joachim, 19 years ago
|
=eligibility edit geht fast
|
-
Property svn:keywords set to
Id
|
File size:
526 bytes
|
Line | |
---|
1 | ##parameters=key=None |
---|
2 | # $Id: get_faculties_voc.py 182 2005-11-16 23:30:12Z joachim $ |
---|
3 | """ |
---|
4 | Return the faculties as an vocabulary |
---|
5 | |
---|
6 | """ |
---|
7 | academics = context.portal_catalog(id = 'academics')[-1].getObject() |
---|
8 | items = [i for i in context.filterContents(items=academics.contentValues()) if i.portal_type == 'Faculty'] |
---|
9 | context.REQUEST.set('items', items) |
---|
10 | context.REQUEST.set('key', key) |
---|
11 | if not key: |
---|
12 | return [(f.getId(),f.title_or_id(),) for f in items] |
---|
13 | return [f.title_or_id() for f in items if f.getId() == key][0] |
---|
14 | return [(f.getId(),f.title_or_id()) for f in items if f.getId() == key] |
---|
15 | |
---|
Note: See
TracBrowser for help on using the repository browser.