##parameters=key=None
# $Id: getDepartmentsVoc.py 2728 2007-11-21 14:13:36Z 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

