source: WAeUP_SRP/branches/joachim-event-branch/skins/waeup_utilities/fixPermAddress.py @ 9819

Last change on this file since 9819 was 1350, checked in by joachim, 18 years ago

added Patch for VocalbulariesTool?, which fixed the loading of to many objects.

  • Property svn:keywords set to Id
File size: 1.0 KB
Line 
1## Script (Python) "search_pins"
2##bind container=container
3##bind context=context
4##bind namespace=
5##bind script=script
6##bind subpath=traverse_subpath
7##parameters=REQUEST
8##title=
9##
10# $Id: fixPermAddress.py 1350 2007-01-25 17:54:18Z joachim $
11"""
12list Students for ClearanceOfficers
13"""
14
15request = REQUEST
16wftool = context.portal_workflow
17mtool = context.portal_membership
18member = mtool.getAuthenticatedMember()
19roles = member.getRolesInContext(context)
20retcat = context.returning_import
21scat = context.students_catalog
22students_folder = context.portal_url.getPortalObject().campus.students
23if str(member) not in ('admin','joachim'):
24    return
25count = 0
26students = retcat()
27#from Products.zdb import set_trace;set_trace()
28for sbrain in students:
29    sres = scat(matric_no=sbrain.matric_no)
30    if not sres:
31        continue
32    student = getattr(students_folder,sres[0].id,None)
33    if student is None:
34        continue
35    per = getattr(student,'personal',None)
36    if per is None:
37        continue
38    per.getContent().edit(mapping={'perm_address':sbrain.Permanent_Address})
39   
40   
41   
Note: See TracBrowser for help on using the repository browser.