Changeset 9706 for main/waeup.kofa/trunk/src/waeup/kofa/students
- Timestamp:
- 21 Nov 2012, 22:37:03 (12 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa/students
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/students/batching.py
r9701 r9706 185 185 return None 186 186 187 def updateEntry(self, obj, row, site ):187 def updateEntry(self, obj, row, site, filename): 188 188 """Update obj to the values given in row. 189 189 """ … … 230 230 # apply other values... 231 231 items_changed += super(StudentProcessor, self).updateEntry( 232 obj, row, site )232 obj, row, site, filename) 233 233 234 234 # Log actions... … … 238 238 # Create mode: the record contains the student_id 239 239 parent.logger.info( 240 '%s - Student recordupdated: %s'241 % ( obj.student_id, items_changed))240 '%s - %s - %s - updated: %s' 241 % (self.name, filename, obj.student_id, items_changed)) 242 242 else: 243 243 # Create mode: the student does not yet exist 244 parent.logger.info('Student data imported: %s' % items_changed) 244 # XXX: It seems that this never happens because student_id 245 # is always set. 246 parent.logger.info( 247 '%s - %s - %s - imported: %s' 248 % (self.name, filename, obj.student_id, items_changed)) 245 249 return items_changed 246 250 … … 418 422 return student.get('studycourse') 419 423 420 def updateEntry(self, obj, row, site ):424 def updateEntry(self, obj, row, site, filename): 421 425 """Update obj to the values given in row. 422 426 """ 423 427 items_changed = super(StudentStudyCourseProcessor, self).updateEntry( 424 obj, row, site )428 obj, row, site, filename) 425 429 parent = self.getParent(row, site) 426 430 parent.__parent__.logger.info( 427 '%s - Study courseupdated: %s'428 % ( parent.student_id, items_changed))431 '%s - %s - %s - updated: %s' 432 % (self.name, filename, parent.student_id, items_changed)) 429 433 # Update the students_catalog 430 434 notify(grok.ObjectModifiedEvent(obj.__parent__)) … … 503 507 return 504 508 505 def updateEntry(self, obj, row, site ):509 def updateEntry(self, obj, row, site, filename): 506 510 """Update obj to the values given in row. 507 511 """ 508 512 items_changed = super(StudentStudyLevelProcessor, self).updateEntry( 509 obj, row, site )513 obj, row, site, filename) 510 514 student = self.getParent(row, site).__parent__ 511 515 student.__parent__.logger.info( 512 '%s - Study levelupdated: %s'513 % (s tudent.student_id, items_changed))516 '%s - %s - %s - updated: %s' 517 % (self.name, filename, student.student_id, items_changed)) 514 518 return 515 519 … … 574 578 return level.get(row['code']) 575 579 576 def updateEntry(self, obj, row, site ):580 def updateEntry(self, obj, row, site, filename): 577 581 """Update obj to the values given in row. 578 582 """ 579 583 items_changed = super(CourseTicketProcessor, self).updateEntry( 580 obj, row, site )584 obj, row, site, filename) 581 585 parent = self.getParent(row, site) 582 586 student = self.getParent(row, site).__parent__.__parent__ 583 587 student.__parent__.logger.info( 584 '%s - Course ticket in %supdated: %s'585 % (s tudent.student_id,parent.level, items_changed))588 '%s - %s - %s - %s - updated: %s' 589 % (self.name, filename, student.student_id, parent.level, items_changed)) 586 590 return 587 591 … … 690 694 return entry 691 695 692 def updateEntry(self, obj, row, site ):696 def updateEntry(self, obj, row, site, filename): 693 697 """Update obj to the values given in row. 694 698 """ 695 699 items_changed = super(StudentOnlinePaymentProcessor, self).updateEntry( 696 obj, row, site )700 obj, row, site, filename) 697 701 student = self.getParent(row, site).__parent__ 698 702 student.__parent__.logger.info( 699 '%s - Payment ticketupdated: %s'700 % (s tudent.student_id, items_changed))703 '%s - %s - %s - updated: %s' 704 % (self.name, filename, student.student_id, items_changed)) 701 705 return 702 706 … … 798 802 return None 799 803 800 def updateEntry(self, obj, row, site ):804 def updateEntry(self, obj, row, site, filename): 801 805 """Update obj to the values given in row. 802 806 """ … … 804 808 vals_to_set = dict((key, val) for key, val in row.items() 805 809 if key not in ('current_session','current_level')) 806 super(StudentVerdictProcessor, self).updateEntry(obj, vals_to_set, site) 810 super(StudentVerdictProcessor, self).updateEntry( 811 obj, vals_to_set, site, filename) 807 812 parent = self.getParent(row, site) 808 813 # Set current_vedict in corresponding studylevel -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_batching.py
r9467 r9706 666 666 # Logging message from updateEntry, 667 667 self.assertTrue( 668 'INFO - system - K1000000 - Study level ' 669 'updated: level=100, level_verdict=C, level_session=2009' 668 'INFO - system - StudentStudyLevel Processor - ' 669 'sample_studylevel_data - K1000000 - updated: ' 670 'level=100, level_verdict=C, level_session=2009' 670 671 in logcontent) 671 672 … … 788 789 self.assertEqual(courseticket.semester, 1) 789 790 shutil.rmtree(os.path.dirname(fin_file)) 790 791 791 logcontent = open(self.logfile).read() 792 792 # Logging message from updateEntry, 793 793 self.assertTrue( 794 'INFO - system - K1000000 - Course ticket in 100 updated: code=COURSE1, ' 794 'INFO - system - CourseTicket Processor - ' 795 'sample_courseticket_data - K1000000 - 100 - ' 796 'updated: code=COURSE1, ' 795 797 'mandatory=False, score=3' 796 798 in logcontent) … … 968 970 # Logging message from updateEntry 969 971 self.assertTrue( 970 'INFO - system - K1000001 - Payment ticket updated: ' 972 'INFO - system - Student Payment Processor - ' 973 'sample_payment_data - K1000001 - updated: ' 971 974 'p_item=BTECHBDT, creation_date=2010-02-15 13:19:01+00:00, ' 972 975 'p_category=schoolfee, amount_auth=19500.0, p_current=True, ' … … 975 978 in logcontent) 976 979 self.assertTrue( 977 'INFO - system - K1000001 - Payment ticket updated: ' 980 'INFO - system - Student Payment Processor - ' 981 'sample_payment_data - K1000001 - updated: ' 978 982 'p_item=BTECHBDT, creation_date=2010-02-15 13:19:01+00:00, ' 979 983 'p_category=schoolfee, amount_auth=19500.6, p_current=True, ' … … 1089 1093 logcontent = open(self.logfile).read() 1090 1094 self.assertMatches( 1091 '... INFO - system - X666666 - Study course updated: current_verdict=0...', 1095 '... INFO - system - Verdict Processor (special processor, ' 1096 'update only) - sample_verdict_data - X666666 - ' 1097 'updated: current_verdict=0...', 1092 1098 logcontent) 1093 1099 self.assertMatches(
Note: See TracChangeset for help on using the changeset viewer.