## Script (Python) "getFormattedStudentEntry" ##bind container=container ##bind context=context ##bind namespace= ##bind script=script ##bind subpath=traverse_subpath ##parameters=brain ##title= ## # $Id: getFormattedStudentEntry.py 1315 2007-01-17 17:38:41Z joachim $ """ return a formatted StudentCatalog Entry """ #from Products.zdb import set_trace;set_trace() fields = context.students_catalog.schema() d = {} for f in fields: d[f] = getattr(brain,f,'--') if f == "sex": if d[f]: d[f] = 'F' else: d[f] = 'M' elif f == "name": d[f] = d[f].strip() return d