source: WAeUP_SRP/branches/srp_backend/skins/waeup_academics/get_faculties_voc.py @ 446

Last change on this file since 446 was 438, checked in by Henrik Bettermann, 18 years ago
File size: 401 bytes
Line 
1##parameters=key=None
2# $Id: get_faculties_voc.py 313 2006-07-15 15:29:56Z joachim $
3"""
4Return the faculties as an vocabulary
5
6"""
7if key is None:
8    res = context.portal_catalog.search({'meta_type': "Faculty"})   
9    return [(d.getId,d.Title,) for d in res]
10res = context.portal_catalog.search({'meta_type': "Faculty", 'id': key})
11if res:
12    return [-1].Title
13return "unknown Faculty %s" % key
Note: See TracBrowser for help on using the repository browser.