## Script (Python) "cpsdocument_edit" ##bind container=container ##bind context=context ##bind namespace= ##bind script=script ##bind subpath=traverse_subpath ##parameters=student=None ##title= ## # $Id: student_edit.py 486 2006-09-06 10:09:39Z joachim $ """ return Info about the Faculties """ request = context.REQUEST wf = context.portal_workflow path_info = request.get('PATH_INFO').split('/') mtool = context.portal_membership pa = context.portal_accommodation info = {} #dep_id = request.get('PATH_TRANSLATED').split('/')[-2] dep_id = context.aq_parent.getId() info['is_manager'] = context.isManager() info['is_student'] = context.isStudent() info['action'] = "%s" % context.absolute_url() info['choosen_ids'] = request.get('ids',[]) info['doc'] = context.getContent() bed_types = pa.uniqueValuesFor('bed_type') bt_list = [] bt_names = context.getBedTypeNames() for bt in bed_types: res = pa(bed_type=bt,hall=context.getId()) bt_list.append({'name': bt_names[bt], 'count': len(res)}) info['bed_types'] = bt_list return info