source: WAeUP_SRP/trunk/skins/waeup_academics/getDepartmentsVoc.py @ 15785

Last change on this file since 15785 was 3339, checked in by Henrik Bettermann, 17 years ago

resolve ticket #507

Now we need a fix which replaces current_mode of all students by the certificate study_mode value.

  • Property svn:keywords set to Id
File size: 333 bytes
Line 
1##parameters=key=None
2# $Id: getDepartmentsVoc.py 3339 2008-03-16 08:38:39Z henrik $
3"""
4Return the faculties as an vocabulary
5
6"""
7if key is None:
8    res = context.portal_catalog.search({'meta_type': "Department"})
9    return [(d.getId(),d.Title,) for d in res]
10res = context.portal_catalog.search({'meta_type': "Department", 'id': key})
11if res:
12    return res[0].Title
13
14raise KeyError
15
Note: See TracBrowser for help on using the repository browser.