source: WAeUP_SRP/trunk/skins/waeup_student/request_admission.py @ 469

Last change on this file since 469 was 467, checked in by joachim, 18 years ago

added StudentCourseResult? to init

File size: 1.9 KB
Line 
1##parameters=REQUEST
2# $Id: check_admission.py 173 2005-11-15 16:28:29Z joachim $
3"""
4process the Admission Form
5return html renderer + psm
6"""
7import DateTime
8current = DateTime.DateTime()
9
10type_name = 'StudentAdmission'
11
12ti = context.portal_types[type_name]
13
14REQUEST.set('type_name',type_name)
15
16validate = REQUEST.has_key("cpsdocument_edit_button")
17
18
19lt = context.portal_layouts
20pr = context.portal_registration
21
22res,psm,ds = lt.renderLayout(layout_id= 'student_check_pin',
23                      schema_id= 'student_admission',
24                      context=context,
25                      mapping=validate and REQUEST,
26                      ob={},
27                      layout_mode='create',
28                      formaction = "request_admission",
29                      submit = "check",
30                      )
31if psm == 'invalid':
32    return context.request_admission_form(rendered = res,
33                                 psm = "Please correct your input",
34                                 ds = ds,
35                                 )
36elif psm == '':
37    return context.request_admission_form(rendered = res,
38                                 psm = None,
39                                 ds = ds,
40                                 )
41elif psm == 'valid':
42    jamb_id = ds.get('jamb_id')
43    catalog = context.portal_catalog
44    search = catalog({'meta_type': 'StudentAdmission',
45                     'jamb_reg_no': jamb_id
46                     })
47   
48    if len(search) < 1:
49        psm = "No JAMB record %s" % (jamb_id)
50        return context.request_admission_form(rendered = res,
51                                 psm = psm,
52                                 ds = ds,
53                                 )
54admission = search[0].getObject()
55student = admission.aq_parent
56student.invokeFactory('StudentClearance','clearance')
57student.invokeFactory('StudentPersonal','personal')
58# now display the passport form with jamb-data readonly
59return student.acknowledge_slip()
60
61
Note: See TracBrowser for help on using the repository browser.