Changeset 16665
- Timestamp:
- 5 Oct 2021, 20:03:55 (3 years ago)
- Location:
- main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/students
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/students/export.py
r16403 r16665 72 72 ICustomStudentOnlinePayment, exclude_attribs=False, 73 73 omit=['display_item']))) + ( 74 'student_id','state','current_session', 'entry_session') 74 'student_id','state','current_session', 'entry_session', 75 'faculty', 'department') 75 76 77 def mangle_value(self, value, name, context=None): 78 """The mangler determines the student's id, registration 79 state and current session. 80 """ 81 if context is not None: 82 student = context.student 83 if name in ['faculty', 'department'] and student is not None: 84 try: 85 if name == 'department': 86 value = student['studycourse'].certificate.__parent__.__parent__.title 87 else: 88 value = student['studycourse'].certificate.__parent__.__parent__.__parent__.title 89 except AttributeError: 90 value = 'N/A' 91 return super( 92 CustomStudentPaymentExporter, self).mangle_value( 93 value, name, context=context) 94 -
main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/students/tests/test_export.py
r16434 r16665 80 80 'r_amount_approved,r_card_num,r_code,r_company,r_desc,' 81 81 'r_pay_reference,thirdparty_amt,student_id,state,' 82 'current_session,entry_session \r\n'82 'current_session,entry_session,faculty,department\r\n' 83 83 '666,12.12,%s-04-01 13:12:01#,,,schoolfee,[],1,my-id,p-item,' 84 84 '100,first,%s,paid,%s-04-01 14:12:01#,,12.12,' 85 '789,r-code,interswitch,,,,A111111,created,2012,2010\r\n' 85 '789,r-code,interswitch,,,,A111111,created,2012,2010,' 86 'Unnamed Faculty,Unnamed Department\r\n' 86 87 % (curr_year-6, curr_year-6, curr_year-6), result 87 88 )
Note: See TracChangeset for help on using the changeset viewer.