source: WAeUP_SRP/trunk/skins/waeup_uniben/getSchoolFee.py @ 8619

Last change on this file since 8619 was 8297, checked in by Henrik Bettermann, 13 years ago

Configure school fees in csv file.

  • Property svn:keywords set to Id
File size: 1023 bytes
Line 
1## Script (Python) "getSchoolFee"
2##bind container=container
3##bind context=context
4##bind namespace=
5##bind script=script
6##bind subpath=traverse_subpath
7##parameters=brain=None
8##title=
9##
10# $Id: getSchoolFee.py 8297 2012-04-27 11:20:01Z henrik $
11"""
12return SchoolFee
13"""
14
15#all_fees = context.uniben_school_fees()
16
17#import csv
18#from Globals import INSTANCE_HOME
19#fees_path = "%s/import/school_fees.csv" % (INSTANCE_HOME)
20#reader = csv.DictReader(open(fees_path, 'r'))
21#lst = [i for i in reader]
22#all_fees = dict([(i['payment_item'],i) for i in lst])
23
24wtool = context.waeup_tool
25try:
26    all_fees = wtool.getSchoolFees()
27except:
28    return None
29next_info = context.getNextInfo(brain)
30next_session_str = next_info['next_session_str']
31description = "School Fee for Session %s" % next_session_str
32
33d = {}
34
35if all_fees.has_key(brain.course):
36    d = all_fees[brain.course]
37    d['description'] = "%s (%s)" % (description,brain.course)
38else:
39    return None
40   
41d['next_session_id'] = next_info['next_session_id']
42                                                   
43return d
44
45
46
Note: See TracBrowser for help on using the repository browser.