Last change
on this file since 1657 was
913,
checked in by Henrik Bettermann, 18 years ago
|
is_* keys removed from get* functions
|
-
Property svn:keywords set to
Id
|
File size:
1.1 KB
|
Rev | Line | |
---|
[845] | 1 | ## Script (Python) "getDepartmentsInfo" |
---|
[551] | 2 | ##bind container=container |
---|
| 3 | ##bind context=context |
---|
| 4 | ##bind namespace= |
---|
| 5 | ##bind script=script |
---|
| 6 | ##bind subpath=traverse_subpath |
---|
| 7 | ##parameters=student=None |
---|
| 8 | ##title= |
---|
| 9 | ## |
---|
[805] | 10 | # $Id: getDepartmentsInfo.py 913 2006-11-21 10:49:45Z henrik $ |
---|
[551] | 11 | """ |
---|
| 12 | return Info about the Faculties |
---|
| 13 | """ |
---|
| 14 | request = context.REQUEST |
---|
| 15 | |
---|
| 16 | wf = context.portal_workflow |
---|
| 17 | mtool = context.portal_membership |
---|
| 18 | member = mtool.getAuthenticatedMember() |
---|
| 19 | path_info = request.get('PATH_INFO').split('/') |
---|
| 20 | |
---|
| 21 | info = {} |
---|
| 22 | member_id = str(member) |
---|
[598] | 23 | roles = member.getRolesInContext(context) |
---|
[573] | 24 | info['action'] = "%s" % context.absolute_url() |
---|
[551] | 25 | info['choosen_ids'] = request.get('ids',[]) |
---|
| 26 | items = [] |
---|
| 27 | info['doc'] = context.getContent() |
---|
| 28 | brain = context.portal_catalog(meta_type="Faculty", id = context.getId())[-1] |
---|
| 29 | cp = brain.getPath() |
---|
| 30 | info['container_path'] = cp |
---|
| 31 | res = context.portal_catalog(container_path=cp) |
---|
| 32 | for r in res: |
---|
| 33 | row = {} |
---|
| 34 | ro = r.getObject() |
---|
| 35 | rd = ro.getContent() |
---|
| 36 | row['id'] = r.getId |
---|
| 37 | row['title'] = rd.LongTitle() |
---|
| 38 | row['url'] = ro.absolute_url() |
---|
[598] | 39 | row['is_editable'] = mtool.checkPermission('Modify portal content', ro) |
---|
[551] | 40 | items.append(row) |
---|
| 41 | info['items'] = items |
---|
| 42 | return info |
---|
Note: See
TracBrowser for help on using the repository browser.