source: WAeUP_SRP/base/skins/waeup_academics/getCertificatesVoc.py @ 3274

Last change on this file since 3274 was 3254, checked in by joachim, 17 years ago

raise KeyError? if key is not in Vocabulary

  • Property svn:keywords set to Id
File size: 334 bytes
Line 
1##parameters=key=None
2# $Id: getCertificatesVoc.py 3254 2008-02-28 13:06:20Z joachim $
3"""
4Return the faculties as an vocabulary
5
6"""
7if key is None:
8    res = context.portal_catalog.search({'meta_type': "Certificate"})   
9    return [(d.getId,d.Title,) for d in res]
10res = context.portal_catalog.search({'meta_type': "Certificate", 'id': key})
11if res:
12    return [-1].Title
13raise KeyError
Note: See TracBrowser for help on using the repository browser.