##parameters=REQUEST # $Id: check_admission.py 173 2005-11-15 16:28:29Z joachim $ """ process the Admission Form return html renderer + psm """ import DateTime current = DateTime.DateTime() type_name = 'StudentAdmission' ti = context.portal_types[type_name] REQUEST.set('type_name',type_name) validate = REQUEST.has_key("cpsdocument_edit_button") lt = context.portal_layouts pr = context.portal_registration res,psm,ds = lt.renderLayout(layout_id= 'student_check_pin', schema_id= 'student_admission', context=context, mapping=validate and REQUEST, ob={}, layout_mode='create', formaction = "request_admission", submit = "check", ) if psm == 'invalid': return context.request_admission_form(rendered = res, psm = "Please correct your input", ds = ds, ) elif psm == '': return context.request_admission_form(rendered = res, psm = None, ds = ds, ) elif psm == 'valid': jamb_id = ds.get('jamb_id') catalog = context.portal_catalog search = catalog({'meta_type': 'StudentAdmission', 'jamb_reg_no': jamb_id }) if len(search) < 1: psm = "No JAMB record %s" % (jamb_id) return context.request_admission_form(rendered = res, psm = psm, ds = ds, ) student = search[0].getObject().aq_parent student.invokeFactory('StudentClearance','clearance') student.invokeFactory('StudentPersonal','personal') return student.acknowledge_slip()