Last change
on this file since 262 was
256,
checked in by joachim, 19 years ago
|
=import from csv
|
-
Property svn:keywords set to
Id
|
File size:
769 bytes
|
Line | |
---|
1 | ##parameters=key=None |
---|
2 | # $Id: get_departments_voc.py 256 2006-06-20 10:44:04Z 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 | #return res |
---|
12 | #return [(d.id,d.Title,) for d in res] |
---|
13 | if key is None: |
---|
14 | res = context.portal_catalog({'meta_type': "Department"}) |
---|
15 | return [(d.getId,d.Title,) for d in res] |
---|
16 | res = context.portal_catalog({'meta_type': "Department", 'id': key}) |
---|
17 | return res[-1].Title |
---|
18 | return [(d.getId,d.title_or_id(),) for d in res][-1] |
---|
19 | |
---|
20 | #return [d.title_or_id() for d in deplist if d.getId() == key][0] |
---|
21 | #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.