Changeset 12873
- Timestamp:
- 23 Apr 2015, 19:27:29 (10 years ago)
- Location:
- main/waeup.kofa/trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/CHANGES.txt
r12865 r12873 4 4 1.3.2.dev0 (unreleased) 5 5 ======================= 6 7 * Convert level into a schema field to be consistent with the documentation. 6 8 7 9 * Rename classes StudentPaymentsExporter and BedTicketsExporter to be -
main/waeup.kofa/trunk/src/waeup/kofa/students/batching.py
r12872 r12873 561 561 factory_name = 'waeup.StudentStudyLevel' 562 562 563 additional_fields = ['level']564 additional_fields_required = additional_fields565 566 563 @property 567 564 def available_fields(self): … … 581 578 if studycourse is None: 582 579 return None 583 return studycourse.get( row['level'])580 return studycourse.get(str(row['level'])) 584 581 585 582 def delEntry(self, row, site): … … 598 595 items_changed = super(StudentStudyLevelProcessor, self).updateEntry( 599 596 obj, row, site, filename) 600 obj.level = int(row['level'])601 597 student = self.getParent(row, site).__parent__ 602 598 student.__parent__.logger.info( … … 607 603 def addEntry(self, obj, row, site): 608 604 parent = self.getParent(row, site) 609 obj.level = int(row['level']) 610 parent[row['level']] = obj 611 return 612 613 def checkConversion(self, row, mode='ignore'): 614 """Validates all values in row. 615 """ 616 errs, inv_errs, conv_dict = super( 617 StudentStudyLevelProcessor, self).checkConversion(row, mode=mode) 618 try: 619 level = int(row['level']) 620 if level not in range(0,1000,10) + [999]: 621 errs.append(('level','no valid integer')) 622 except ValueError: 623 errs.append(('level','no integer')) 624 return errs, inv_errs, conv_dict 605 parent[str(row['level'])] = obj 606 return 625 607 626 608 class CourseTicketProcessor(StudentProcessorBase): … … 653 635 if student is None: 654 636 return None 655 return student['studycourse'].get( row['level'])637 return student['studycourse'].get(str(row['level'])) 656 638 657 639 def getEntry(self, row, site): -
main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py
r12854 r12873 1321 1321 grok.name('index') 1322 1322 grok.require('waeup.viewStudent') 1323 form_fields = grok.AutoFields(IStudentStudyLevel) 1323 form_fields = grok.AutoFields(IStudentStudyLevel).omit('level') 1324 1324 form_fields[ 1325 1325 'validation_date'].custom_widget = FriendlyDatetimeDisplayWidget('le') … … 1353 1353 form_fields = grok.AutoFields(IStudentStudyLevel) 1354 1354 form_fields[ 1355 'validation_date'].custom_widget = FriendlyDatetimeDisplayWidget('le') 1355 'validation_date'].custom_widget = FriendlyDatetimeDisplayWidget('le').omit('level') 1356 1356 prefix = 'form' 1357 1357 omit_fields = ( … … 1434 1434 grok.template('studylevelmanagepage') 1435 1435 form_fields = grok.AutoFields(IStudentStudyLevel).omit( 1436 'validation_date', 'validated_by', 'total_credits', 'gpa' )1436 'validation_date', 'validated_by', 'total_credits', 'gpa', 'level') 1437 1437 pnav = 4 1438 1438 taboneactions = [_('Save'),_('Cancel')] … … 2597 2597 grok.require('waeup.editStudyLevel') 2598 2598 grok.template('studyleveleditpage') 2599 form_fields = grok.AutoFields(IStudentStudyLevel).omit(2600 'level_session', 'level_verdict')2601 2599 pnav = 4 2602 2600 placeholder = _('Enter valid course code') -
main/waeup.kofa/trunk/src/waeup/kofa/students/export.py
r12865 r12873 297 297 298 298 fields = tuple(sorted(iface_names( 299 IStudentStudyLevel) + ['level'])) + (299 IStudentStudyLevel))) + ( 300 300 'student_id', 'number_of_tickets','certcode') 301 301 title = _(u'Student Study Levels') -
main/waeup.kofa/trunk/src/waeup/kofa/students/interfaces.py
r12518 r12873 562 562 563 563 """ 564 level = Attribute('The level code')565 564 number_of_tickets = Attribute('Number of tickets contained in this level') 566 565 certcode = Attribute('The certificate code of the study course') 567 566 is_current_level = Attribute('Is this level the current level of the student?') 568 567 passed_params = Attribute('Information about passed and failed courses') 568 569 level = schema.Choice( 570 title = _(u'Level'), 571 source = StudyLevelSource(), 572 required = True, 573 readonly = False, 574 ) 569 575 570 576 level_session = schema.Choice( -
main/waeup.kofa/trunk/src/waeup/kofa/students/studylevel.py
r10631 r12873 67 67 def __init__(self): 68 68 super(StudentStudyLevel, self).__init__() 69 self.level = None70 69 return 71 70 -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_batching.py
r12868 r12873 764 764 dict(reg_number='1', level='1000')) 765 765 self.assertEqual(len(errs),1) 766 self.assertTrue(('level', 'no valid integer') in errs)766 self.assertTrue(('level', u'Invalid value') in errs) 767 767 errs, inv_errs, conv_dict = self.processor.checkConversion( 768 768 dict(reg_number='1', level='xyz')) 769 769 self.assertEqual(len(errs),1) 770 self.assertTrue(('level', 'no integer') in errs)770 self.assertTrue(('level', u'Invalid value') in errs) 771 771 772 772 def test_import(self):
Note: See TracChangeset for help on using the changeset viewer.