source: WAeUP_SRP/branches/joachim-azax-branch/skins/waeup_student/getFormattedStudentEntry.py @ 11156

Last change on this file since 11156 was 1970, checked in by joachim, 17 years ago

add dumpStudentsCatalog

  • Property svn:keywords set to Id
File size: 615 bytes
Line 
1## Script (Python) "getFormattedStudentEntry"
2##bind container=container
3##bind context=context
4##bind namespace=
5##bind script=script
6##bind subpath=traverse_subpath
7##parameters=brain
8##title=
9##
10# $Id: getFormattedStudentEntry.py 1970 2007-06-26 15:01:57Z joachim $
11"""
12return a formatted StudentCatalog Entry
13"""
14#from Products.zdb import set_trace;set_trace()
15fields = context.students_catalog.schema()
16d = {}
17for f in fields:
18    d[f] = getattr(brain,f,'')
19    if not d[f]:
20        d[f] = ''
21    if f == "sex":
22        if d[f]:
23            d[f] = 'F'
24        else:
25            d[f] = 'M'
26    elif f == "name":
27        d[f] = d[f].strip()
28           
29return d           
Note: See TracBrowser for help on using the repository browser.