Last change
on this file since 7454 was
182,
checked in by joachim, 19 years ago
|
=eligibility edit geht fast
|
-
Property svn:keywords set to
Id
|
File size:
702 bytes
|
Line | |
---|
1 | ##parameters=key=None |
---|
2 | # $Id: get_departments_voc.py 182 2005-11-16 23:30:12Z joachim $ |
---|
3 | """ |
---|
4 | Return the faculties as an vocabulary |
---|
5 | |
---|
6 | """ |
---|
7 | #academics = context.sections.portal.academics |
---|
8 | academics = context.portal_catalog(id = 'academics')[0].getObject() |
---|
9 | faculties = [f for f in context.filterContents(items=academics.contentValues()) if f.portal_type == 'Faculty'] |
---|
10 | |
---|
11 | deplist = [] |
---|
12 | for faculty in faculties: |
---|
13 | departments = [d for d in context.filterContents(items=faculty.contentValues()) if d.portal_type == 'Department'] |
---|
14 | deplist.extend(departments) |
---|
15 | if not key: |
---|
16 | return [(d.getId(),d.title_or_id(),) for d in deplist] |
---|
17 | return [d.title_or_id() for d in deplist if d.getId() == key][0] |
---|
18 | 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.