Changeset 8583 for main/waeup.aaue
- Timestamp:
- 31 May 2012, 20:34:23 (12 years ago)
- Location:
- main/waeup.aaue/trunk/src/waeup/aaue
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.aaue/trunk/src/waeup/aaue/applicants/batching.py
r8444 r8583 21 21 from waeup.kofa.utils.batching import BatchProcessor 22 22 from waeup.kofa.applicants.batching import ApplicantProcessor 23 from waeup.aaue.applicants.interfaces import ICustomApplicant 23 from waeup.aaue.applicants.interfaces import ( 24 ICustomApplicant, ICustomApplicantUpdateByRegNo) 24 25 25 26 class CustomApplicantProcessor(ApplicantProcessor): … … 36 37 """ 37 38 iface = ICustomApplicant 39 iface_byregnumber = ICustomApplicantUpdateByRegNo -
main/waeup.aaue/trunk/src/waeup/aaue/applicants/interfaces.py
r8567 r8583 38 38 UG_OMIT_MANAGE_FIELDS = () 39 39 UG_OMIT_EDIT_FIELDS = UG_OMIT_MANAGE_FIELDS + ('locked', 'course_admitted', 40 'student_id', 'screening_score', 'screening_venue', 'notice') 40 'student_id', 'screening_score', 'screening_venue', 'notice', 41 'screening_date') 41 42 PUTME_OMIT_EDIT_FIELDS = UG_OMIT_EDIT_FIELDS + ( 42 43 'firstname', 'middlename', 'lastname', 'sex', … … 48 49 PG_OMIT_EDIT_FIELDS = PG_OMIT_MANAGE_FIELDS + ( 49 50 'locked', 'course_admitted', 50 'student_id', 'screening_score', 'screening_venue', 'notice') 51 'student_id', 'screening_score', 'screening_venue', 'notice', 52 'screening_date') 51 53 52 54 class IUGApplicant(IApplicantBaseData): … … 96 98 screening_venue = schema.TextLine( 97 99 title = _(u'Screening Venue'), 100 required = False, 101 ) 102 screening_date = schema.TextLine( 103 title = _(u'Screening Date'), 98 104 required = False, 99 105 ) … … 271 277 readonly = False, 272 278 ) 279 screening_date = schema.TextLine( 280 title = _(u'Screening Date'), 281 required = False, 282 ) 273 283 screening_score = schema.Int( 274 284 title = _(u'Screening Score'), … … 361 371 IPUTMEApplicantEdit[ 362 372 'email'].order = IUGApplicant['email'].order 373 374 class ICustomApplicantUpdateByRegNo(ICustomApplicant): 375 """Representation of an applicant. 376 377 Skip regular reg_number validation if reg_number is used for finding 378 the applicant object. 379 """ 380 reg_number = schema.TextLine( 381 title = u'Registration Number', 382 required = False, 383 ) -
main/waeup.aaue/trunk/src/waeup/aaue/applicants/tests.py
r8536 r8583 36 36 from waeup.aaue.testing import FunctionalLayer 37 37 from waeup.aaue.applicants.export import CustomApplicantsExporter 38 from waeup.aaue.applicants.batching import CustomApplicantProcessor 38 39 39 40 … … 235 236 applicant.screening_score = 98 236 237 applicant.screening_venue = u'Exam Room' 238 applicant.screening_date = u'Saturday, 16th June 2012 2:00:00 PM' 237 239 applicant.password = 'any password' 238 240 return applicant 239 241 240 def test_export_ all(self):242 def test_export_reimport_all(self): 241 243 # we can export all applicants in a portal 242 244 # set values we can expect in export file … … 257 259 'nationality,notice,nysc_lga,' 258 260 'nysc_year,password,perm_address,phone,pp_school,presently_inst,' 259 'reg_number,screening_score,screening_venue,sex,state,student_id,' 261 'reg_number,screening_date,screening_score,screening_venue,sex,' 262 'state,student_id,' 260 263 'container_code' 261 264 in result) … … 263 266 'Application initialized by system\'],,,,,,,,,Tester,,0,M.,,' 264 267 '"Some notice\nin lines.",,,any password,,+234-123-12345,,,' 265 '123456,98,Exam Room,f,initialized,,dp2011' in result) 266 return 268 '123456,"Saturday, 16th June 2012 2:00:00 PM",98,Exam Room,f,' 269 'initialized,,dp2011' in result) 270 # We can import the same file with if we ignore some columns. 271 # Since the applicants_catalog hasn't been notified, the same 272 # record with same reg_number can be imported twice. 273 processor = CustomApplicantProcessor() 274 result = processor.doImport( 275 self.outfile, 276 ['ignore1','application_date','ignore2','course1','course2','' 277 'course_admitted','date_of_birth','ignore3','email','emp2_end','' 278 'emp2_position','emp2_reason','emp2_start','emp_end','emp_position','' 279 'emp_reason','emp_start','employer','employer2','firstname','ignore4','' 280 'hq_degree','hq_disc','hq_matric_no','hq_school','hq_session','hq_type','' 281 'jamb_score','jamb_subjects','lastname','lga','locked','middlename','' 282 'nationality','notice','nysc_lga','' 283 'nysc_year','password','perm_address','phone','pp_school','presently_inst','' 284 'reg_number','screening_date','screening_score','screening_venue','sex','' 285 'state','student_id','container_code'], 286 mode='create') 287 num_succ, num_fail, finished_path, failed_path = result 288 self.assertEqual(num_succ,1) 289 self.assertEqual(num_fail,0) 290 return -
main/waeup.aaue/trunk/src/waeup/aaue/students/batching.py
r8444 r8583 25 25 """ 26 26 from waeup.aaue.students.interfaces import ( 27 ICustomStudent, 27 ICustomStudent, ICustomStudentUpdateByRegNo, 28 ICustomStudentUpdateByMatricNo 28 29 ) 29 30 from waeup.kofa.students.batching import StudentProcessor … … 33 34 """ 34 35 iface = ICustomStudent 36 iface_byregnumber = ICustomStudentUpdateByRegNo 37 iface_bymatricnumber = ICustomStudentUpdateByMatricNo -
main/waeup.aaue/trunk/src/waeup/aaue/students/interfaces.py
r8505 r8583 33 33 from waeup.aaue.interfaces import MessageFactory as _ 34 34 from waeup.aaue.payments.interfaces import ICustomOnlinePayment 35 from waeup.aaue.utils.lgas import LGAS 35 36 36 37 … … 381 382 382 383 """ 384 385 class ICustomStudentUpdateByRegNo(ICustomStudent): 386 """Representation of a student. Skip regular reg_number validation. 387 388 """ 389 reg_number = schema.TextLine( 390 title = _(u'Registration Number'), 391 required = False, 392 ) 393 394 class ICustomStudentUpdateByMatricNo(ICustomStudent): 395 """Representation of a student. Skip regular matric_number validation. 396 397 """ 398 matric_number = schema.TextLine( 399 title = _(u'Matriculation Number'), 400 required = False, 401 )
Note: See TracChangeset for help on using the changeset viewer.