source: WAeUP_SRP/branches/srpp_branch/skins/waeup_faculty/get_faculties_voc.py @ 6442

Last change on this file since 6442 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"""
4Return the faculties as an vocabulary
5
6"""
7academics = context.portal_catalog(id = 'academics')[-1].getObject()
8items = [i for i in context.filterContents(items=academics.contentValues()) if i.portal_type == 'Faculty']
9context.REQUEST.set('items', items)
10context.REQUEST.set('key', key)
11if not key:
12    return [(f.getId(),f.title_or_id(),) for f in items]
13return [f.title_or_id() for f in items if f.getId() == key][0]
14return [(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.