source: WAeUP_SRP/trunk/skins/waeup_student/pay_hostel_fee.py @ 457

Last change on this file since 457 was 404, checked in by joachim, 18 years ago

accommodation startet

  • Property svn:keywords set to Id
File size: 1.3 KB
RevLine 
[114]1##parameters=REQUEST
2# $Id: pay_hostel_fee.py 404 2006-08-22 21:45:50Z joachim $
3"""
[404]4book an accommodation
[114]5"""
[166]6import DateTime
7current = DateTime.DateTime()
8
[114]9type_name = 'Student'
10ti = context.portal_types[type_name]
11pm = context.portal_membership
12REQUEST.set('type_name',type_name)
13
14validate = REQUEST.has_key("cpsdocument_edit_button")
15
16
17lt = context.portal_layouts
18pr = context.portal_registration
19
[166]20res,psm,ds = lt.renderLayout(layout_id= 'accopay',
21                      schema_id= 'student_hostel_fee',
[114]22                      context=context,
23                      mapping=validate and REQUEST,
24                      ob={},
25                      layout_mode='create',
[166]26                      submit = "pay",
27                      action = 'pay_hostel_fee',
[114]28                      )
29if psm == 'invalid':
[164]30    return context.book_accommodation_form(rendered = res,
[114]31                                 psm = "Please correct your input",
32                                 ds = ds,
33                                 )
34elif psm == '':
[164]35    return context.book_accommodation_form(rendered = res,
[114]36                                 psm = None,
37                                 ds = ds,
38                                 )
39elif psm == 'valid':
40    sf = context.getContent()
[166]41
42    ds.set('sc_date',current)
43    sf.setScratchCardData('hostel_fee',ds)
44
45    return context.payed_hostel_fee(dict=ds)
Note: See TracBrowser for help on using the repository browser.