Last change
on this file since 179 was
173,
checked in by joachim, 19 years ago
|
=added Faculties and Departments in install + other cosmetics
|
-
Property svn:keywords set to
Id
|
File size:
637 bytes
|
Line | |
---|
1 | ##parameters=key=None |
---|
2 | # $Id: get_departments_voc.py 173 2005-11-15 16:28:29Z joachim $ |
---|
3 | """ |
---|
4 | Return the faculties as an vocabulary |
---|
5 | |
---|
6 | """ |
---|
7 | academics = context.sections.portal.academics |
---|
8 | faculties = [f for f in context.filterContents(items=academics.contentValues()) if f.portal_type == 'Faculty'] |
---|
9 | |
---|
10 | deplist = [] |
---|
11 | for faculty in faculties: |
---|
12 | departments = [d for d in context.filterContents(items=faculty.contentValues()) if d.portal_type == 'Department'] |
---|
13 | deplist.extend(departments) |
---|
14 | if key is None: |
---|
15 | return [(d.getId(),d.title_or_id(),) for d in deplist] |
---|
16 | return [d.title_or_id() for d in deplist if d.getId() == key][0] |
---|
17 | return [(d.getId(),d.title_or_id()) for d in deplist if d.getId() == key] |
---|
Note: See
TracBrowser for help on using the repository browser.