source: WAeUP_SRP/trunk/skins/waeup_student/getFormattedStudentEntry.py @ 1376

Last change on this file since 1376 was 1315, checked in by joachim, 18 years ago

M skins/waeup_student/getFormattedStudentEntry.py
do the sex right.
M skins/waeup_student/getSessionResults.py
remove wrong getattr(student,'clearance')
M profiles/default/schemas/student_study_course.xml
removed redundant fields

  • Property svn:keywords set to Id
File size: 569 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 1315 2007-01-17 17:38:41Z 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 f == "sex":
20        if d[f]:
21            d[f] = 'F'
22        else:
23            d[f] = 'M'
24    elif f == "name":
25        d[f] = d[f].strip()
26return d           
Note: See TracBrowser for help on using the repository browser.