Last change
on this file since 17946 was
1593,
checked in by uli, 18 years ago
|
Merged current trunk into uli-branch.
|
-
Property svn:keywords set to
Id
|
File size:
899 bytes
|
Rev | Line | |
---|
[1593] | 1 | ## Script (Python) "getSchoolFeePrefix" |
---|
[1274] | 2 | ##bind container=container |
---|
| 3 | ##bind context=context |
---|
| 4 | ##bind namespace= |
---|
| 5 | ##bind script=script |
---|
| 6 | ##bind subpath=traverse_subpath |
---|
| 7 | ##parameters= |
---|
| 8 | ##title= |
---|
| 9 | ## |
---|
| 10 | # $Id:getMaintenancePrefix.py 486 2006-09-06 10:09:39Z joachim $ |
---|
| 11 | """ |
---|
| 12 | return the Prefix for Schoolfee |
---|
| 13 | """ |
---|
[1364] | 14 | |
---|
| 15 | if context.portal_membership.isAnonymousUser(): |
---|
| 16 | return None |
---|
| 17 | |
---|
[1593] | 18 | import logging |
---|
| 19 | logger = logging.getLogger('Skins.getSchoolFeePrefix') |
---|
[1364] | 20 | |
---|
[1274] | 21 | student_id = context.getStudentId() |
---|
| 22 | sbrain = context.students_catalog(id=student_id)[0] |
---|
| 23 | res = context.portal_catalog(portal_type="Certificate", |
---|
| 24 | id = sbrain.course) |
---|
| 25 | if not res: |
---|
[1593] | 26 | logger.info('%s, certificate %s not found' % (student_id,course)) |
---|
[1286] | 27 | prefix = "--" |
---|
| 28 | else: |
---|
[1274] | 29 | prefix = res[0].getObject().getContent().school_fee_code |
---|
| 30 | if not prefix or prefix == 'none': |
---|
| 31 | prefix = res[0].getPath().split('/')[-4] |
---|
| 32 | return prefix |
---|
Note: See
TracBrowser for help on using the repository browser.