## Script (Python) "getMaintenancePrefix" ##bind container=container ##bind context=context ##bind namespace= ##bind script=script ##bind subpath=traverse_subpath ##parameters= ##title= ## # $Id:getMaintenancePrefix.py 486 2006-09-06 10:09:39Z joachim $ """ return the Prefix for Schoolfee """ student_id = context.getStudentId() sbrain = context.students_catalog(id=student_id)[0] res = context.portal_catalog(portal_type="Certificate", id = sbrain.course) if not res: logger.info('"%s","certificate not found", "%s"' % (student_id,course)) prefix = "--" else: prefix = res[0].getObject().getContent().school_fee_code if not prefix or prefix == 'none': prefix = res[0].getPath().split('/')[-4] return prefix