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

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

=added Faculties and Departments in install + other cosmetics

  • Property svn:keywords set to Id
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
10
11type_name = 'Jamb'
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= 'admission',
23                      schema_id= 'student_admission',
24                      context=context,
25                      mapping=validate and REQUEST,
26                      ob={},
27                      layout_mode='create',
28                      action = "check_admission",
29                      submit = "check",
30                      )
31if psm == 'invalid':
32    return context.check_admission_form(rendered = res,
33                                 psm = "Please correct your input",
34                                 ds = ds,
35                                 )
36elif psm == '':
37    return context.check_admission_form(rendered = res,
38                                 psm = None,
39                                 ds = ds,
40                                 )
41elif psm == 'valid':
42    s_id = "s%s" % ds.get('jamb_id')
43    catalog = context.portal_catalog
44    search = catalog(SearchableText = "%s*" % s_id)
45    student = getattr(context,s_id,None)
46    if student is None:
47    #if len(search) < 1:
48        psm = "Your are not admitted"
49        return context.check_admission_form(rendered = res,
50                                 psm = psm,
51                                 ds = ds,
52                                 )
53
54ds.set('sc_date',current)
55student.getContent().setScratchCardData('adm_check',ds)
56
57jamb = getattr(student,'JAMB')
58res = jamb.getContent().render(layout_id = 'admission_slip',
59                               layout_mode = 'view',
60                               schema_id = 'jamb')
61
62return context.admission_slip_form(rendered = res, dict = ds)
63
Note: See TracBrowser for help on using the repository browser.