source: WAeUP_SRP/trunk/skins/waeup_academics/get_departments_voc.py @ 331

Last change on this file since 331 was 313, checked in by joachim, 19 years ago

=get_department_voc, get_faculty_voc

  • Property svn:keywords set to Id
File size: 357 bytes
RevLine 
[173]1##parameters=key=None
2# $Id: get_departments_voc.py 313 2006-07-15 15:29:56Z joachim $
3"""
4Return the faculties as an vocabulary
5
6"""
[256]7if key is None:
[265]8    res = context.portal_catalog.search({'meta_type': "Department"})   
[256]9    return [(d.getId,d.Title,) for d in res]
[312]10res = context.portal_catalog.search({'meta_type': "Department", 'id': key})
11if res:
12    return res[-1].Title
[313]13return "unknown Department %s" % key
[312]14
Note: See TracBrowser for help on using the repository browser.