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

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

implement certificates_catalog

  • Property svn:keywords set to Id
File size: 521 bytes
RevLine 
[3339]1##parameters=key=None
[2727]2# $Id: getCertificatesVoc.py 3494 2008-05-08 09:35:54Z joachim $
3"""
4Return the faculties as an vocabulary
5
6"""
[3494]7# if key is None:
8#     res = context.portal_catalog.search({'meta_type': "Certificate"})
9#     return [(d.getId,d.Title,) for d in res]
10# res = context.portal_catalog.search({'meta_type': "Certificate", 'id': key})
11# if res:
12#     return res[0].Title
[2727]13if key is None:
[3494]14    res = context.certificates_catalog()
15    return [(d.code,d.title,) for d in res]
16res = context.certificates_catalog(code=key)
[2727]17if res:
[3494]18    return res[0].title
[3254]19raise KeyError
Note: See TracBrowser for help on using the repository browser.