Changeset 17862 for main/waeup.uniben
- Timestamp:
- 29 Jul 2024, 14:01:38 (3 months ago)
- Location:
- main/waeup.uniben/trunk/src/waeup/uniben/students
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.uniben/trunk/src/waeup/uniben/students/export.py
r17852 r17862 20 20 import grok 21 21 from datetime import datetime 22 from waeup.kofa.interfaces import IKofaUtils 23 from zope.component import getUtility 22 24 from waeup.uniben.students.interfaces import ( 23 25 ICustomStudent, … … 197 199 'lg_area', 198 200 'current_mode', 199 'cert code',201 'certificate', 200 202 'faccode', 201 203 'depcode', … … 204 206 'current_verdict', 205 207 'entry_session', 206 'faccode',207 'depcode',208 'certcode',209 208 'nysc_verdict', 210 209 'nysc_senate_info', … … 223 222 224 223 def mangle_value(self, value, name, context=None): 224 verdicts = getUtility(IKofaUtils).VERDICTS_DICT 225 225 if name in ('lg_state', 'lg_area') and context.lga: 226 226 value = context.lga … … 231 231 if name == 'lg_area': 232 232 value = '-'.join(value.split('_')[1:]) 233 if name == 'certificate': 234 cert = getattr(context.get('studycourse', None), 'certificate', None) 235 if cert is not None: 236 value = cert.title 237 if name == 'nysc_verdict' and value: 238 value = verdicts[value] 233 239 return super( 234 240 NYSCExporter, self).mangle_value( -
main/waeup.uniben/trunk/src/waeup/uniben/students/tests/test_export.py
r17852 r17862 178 178 self.setup_student(self.student) 179 179 self.student.nysc = True 180 self.student.nysc_verdict = 'B' 180 181 self.student.nysc_processed = False 181 182 self.student.lga = u'cross_river_abc' … … 185 186 self.assertMatches( 186 187 'student_id,matric_number,reg_number,firstname,middlename,lastname,' 187 'sex,nationality,date_of_birth,state,lg_state,lg_area,current_mode,certcode,faccode,' 188 'depcode,current_level,current_session,current_verdict,' 189 'entry_session,faccode,depcode,certcode,nysc_verdict,' 190 'nysc_senate_info,nysc_date_of_graduation,nysc_updated,nysc_processed,%s\r\n' 191 'A111111,234,123,Anna,M.,Tester,f,NG,1981-02-04#,created,cross-river,abc,ug_ft,' 192 'CERT1,NA,NA,200,2012,0,2010,NA,NA,CERT1,,,,,0,,,,,,12.12,,,,,,\r\n' % year_range_str, 188 'sex,nationality,date_of_birth,state,lg_state,lg_area,current_mode,' 189 'certificate,faccode,depcode,current_level,current_session,' 190 'current_verdict,entry_session,nysc_verdict,nysc_senate_info,' 191 'nysc_date_of_graduation,nysc_updated,nysc_processed,%s\r\n' 192 'A111111,234,123,Anna,M.,Tester,f,NG,1981-02-04#,created,' 193 'cross-river,abc,ug_ft,Unnamed Certificate,NA,NA,200,2012,0,2010,' 194 'Student with carryover courses,,,,0,,,,,,' 195 '12.12,,,,,,\r\n' % year_range_str, 193 196 result 194 197 )
Note: See TracChangeset for help on using the changeset viewer.