##parameters=key=None
# $Id: get_departments_voc.py 389 2006-08-18 06:49:13Z joachim $
"""
Return the faculties as an vocabulary

"""
if key is None:
    res = context.portal_catalog.search({'meta_type': "Department"})    
    return [(d.getId(),d.Title,) for d in res]
res = context.portal_catalog.search({'meta_type': "Department", 'id': key})
if res:
    return res[-1].Title
return "unknown Department %s" % key

