source: waeup_product/trunk/skins/waeup_student/check_admission.py @ 164

Last change on this file since 164 was 164, checked in by joachim, 19 years ago

=clearence + eligibility added

  • Property svn:keywords set to Id
File size: 1.7 KB
Line 
1##parameters=REQUEST
2# $Id: check_admission.py 164 2005-11-10 21:40:01Z joachim $
3"""
4process the Admission Form
5return html renderer + psm
6"""
7type_name = 'Jamb'
8ti = context.portal_types[type_name]
9
10REQUEST.set('type_name',type_name)
11
12validate = REQUEST.has_key("cpsdocument_edit_button")
13
14
15lt = context.portal_layouts
16pr = context.portal_registration
17
18res,psm,ds = lt.renderLayout(layout_id= 'admission',
19                      schema_id= 'student_admission',
20                      context=context,
21                      mapping=validate and REQUEST,
22                      ob={},
23                      layout_mode='create',
24                      )
25if psm == 'invalid':
26    return context.check_admission_form(rendered = res,
27                                 psm = "Please correct your input",
28                                 ds = ds,
29                                 )
30elif psm == '':
31    return context.check_admission_form(rendered = res,
32                                 psm = None,
33                                 ds = ds,
34                                 )
35elif psm == 'valid':
36    s_id = "s%s" % ds.get('jamb_id')
37    catalog = context.portal_catalog
38    search = catalog(SearchableText = "%s*" % s_id)
39    student = getattr(context,s_id,None)
40    if student is None:
41    #if len(search) < 1:
42        psm = "Your are not admitted"
43        return context.check_admission_form(rendered = res,
44                                 psm = psm,
45                                 ds = ds,
46                                 )
47student.getContent().setScratchCardData('adm_check',ds)
48
49jamb = getattr(student,'JAMB')
50res = jamb.getContent().render(layout_id = 'admission_slip',
51                               layout_mode = 'view',
52                               schema_id = 'jamb')
53
54return jamb.admission_slip_form(rendered = res, dict = ds)
55
Note: See TracBrowser for help on using the repository browser.