source: WAeUP_SRP/branches/regebro-noskins/skins/waeup_academics/getDepartmentsInfo.py @ 11107

Last change on this file since 11107 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
Line 
1## Script (Python) "getDepartmentsInfo"
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##
10# $Id: getDepartmentsInfo.py 913 2006-11-21 10:49:45Z henrik $
11"""
12return Info about the Faculties
13"""
14request = context.REQUEST
15
16wf = context.portal_workflow
17mtool = context.portal_membership
18member = mtool.getAuthenticatedMember()
19path_info = request.get('PATH_INFO').split('/')
20
21info = {}
22member_id = str(member)
23roles = member.getRolesInContext(context)
24info['action'] = "%s" % context.absolute_url()
25info['choosen_ids'] = request.get('ids',[])
26items = []
27info['doc'] = context.getContent()
28brain = context.portal_catalog(meta_type="Faculty", id = context.getId())[-1]
29cp = brain.getPath()
30info['container_path'] = cp
31res = context.portal_catalog(container_path=cp)
32for 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()
39    row['is_editable'] = mtool.checkPermission('Modify portal content', ro)
40    items.append(row)
41info['items'] = items
42return info
Note: See TracBrowser for help on using the repository browser.