Changeset 15203 for main/waeup.kofa/trunk/src/waeup/kofa
- Timestamp:
- 28 Oct 2018, 17:30:45 (6 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa/students
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/students/batching.py
r15163 r15203 649 649 `fcode` and `dcode` can nevermore be changed, neither via the user interface 650 650 nor by import. Other values can be overwritten by import. 651 652 `ticket_session` is an additional attribute which can be used to store the 653 session of the course when it was taken. Usually this information is 654 redundantbecause the the parent study level object already contains this 655 information except for the study level zero container which can be used to 656 store 'orphaned' course tickets. 651 657 """ 652 658 grok.implements(IBatchProcessor) … … 669 675 'mandatory', 'score', 'carry_over', 'automatic', 670 676 'outstanding', 'course_category', 'level_session', 671 'title', 'credits', 'passmark', 'semester' 677 'title', 'credits', 'passmark', 'semester', 'ticket_session' 672 678 ] + self.additional_fields 673 679 return sorted(fields) -
main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py
r15197 r15203 1030 1030 level_code = self.request.form.get('addlevel', None) 1031 1031 level_session = self.request.form.get('level_session', None) 1032 if not level_session :1032 if not level_session and not level_code == '0': 1033 1033 self.flash(_('You must select a session for the level.'), 1034 1034 type="warning") 1035 1035 self.redirect(self.url(self.context, u'@@manage')+'#tab2') 1036 1036 return 1037 if level_session and level_code == '0': 1038 self.flash(_('Level zero must not be assigned a session.'), 1039 type="warning") 1040 self.redirect(self.url(self.context, u'@@manage')+'#tab2') 1041 return 1037 1042 studylevel = createObject(u'waeup.StudentStudyLevel') 1038 1043 studylevel.level = int(level_code) 1039 studylevel.level_session = int(level_session) 1044 if level_code != '0': 1045 studylevel.level_session = int(level_session) 1040 1046 try: 1041 1047 self.context.addStudentStudyLevel( … … 1306 1312 self.semester_dict = getUtility(IKofaUtils).SEMESTER_DICT 1307 1313 self.level_dict = level_dict(self.context) 1308 self.session_dict = dict( 1314 self.session_dict = dict([(None, 'None'),] + 1309 1315 [(item[1], item[0]) for item in academic_sessions()]) 1310 1316 self.studymode_dict = getUtility(IKofaUtils).STUDY_MODES_DICT … … 1340 1346 self.semester_dict = getUtility(IKofaUtils).SEMESTER_DICT 1341 1347 self.level_dict = level_dict(self.context) 1342 self.session_dict = dict( 1348 self.session_dict = dict([(None, 'None'),] + 1343 1349 [(item[1], item[0]) for item in academic_sessions()]) 1344 1350 self.studymode_dict = getUtility(IKofaUtils).STUDY_MODES_DICT … … 1483 1489 level_title = translate(self.context.level_title, 'waeup.kofa', 1484 1490 target_language=lang) 1485 return _('${a}: Study Level${b}', mapping = {1491 return _('${a}: ${b}', mapping = { 1486 1492 'a':self.context.student.display_fullname, 1487 1493 'b':level_title}) … … 1613 1619 level_title = translate(self.context.level_title, 'waeup.kofa', 1614 1620 target_language=lang) 1615 return _('Manage study level${a}',1621 return _('Manage ${a}', 1616 1622 mapping = {'a':level_title}) 1617 1623 … … 1777 1783 grok.name('index') 1778 1784 grok.require('waeup.viewStudent') 1779 form_fields = grok.AutoFields(ICourseTicket).omit('course_category') 1785 form_fields = grok.AutoFields(ICourseTicket).omit('course_category', 1786 'ticket_session') 1780 1787 grok.template('courseticketpage') 1781 1788 pnav = 4 … … 1803 1810 form_fields['automatic'].for_display = True 1804 1811 form_fields['carry_over'].for_display = True 1812 form_fields['ticket_session'].for_display = True 1805 1813 pnav = 4 1806 1814 grok.template('courseticketmanagepage') -
main/waeup.kofa/trunk/src/waeup/kofa/students/browser_templates/transcript.pt
r15163 r15203 46 46 level['tickets_2'], level['tickets_3'])"> 47 47 <tr tal:repeat="ticket semester_tickets"> 48 <td tal:content="python: view.level_dict [ticket.level]">LEVEL</td>48 <td tal:content="python: view.level_dict.get('ticket.level', ticket.level)">LEVEL</td> 49 49 <td tal:content="python: view.session_dict[ticket.level_session]">SESSION</td> 50 50 <td tal:content="python: view.semester_dict[ticket.semester]">SEMESTER</td> -
main/waeup.kofa/trunk/src/waeup/kofa/students/interfaces.py
r15197 r15203 18 18 #from datetime import datetime 19 19 from zope.component import getUtility 20 from zope.interface import Attribute, Interface 20 from zope.interface import Attribute, Interface, invariant, Invalid 21 21 from zope import schema 22 22 from zc.sourcefactory.contextual import BasicContextualSourceFactory … … 662 662 ) 663 663 664 ticket_session = schema.Choice( 665 title = _(u'Imported Session'), 666 source = academic_sessions_vocab, 667 required = False, 668 ) 669 664 670 passmark = schema.Int( 665 671 title = _(u'Passmark'), -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/sample_courseticket_data.csv
r9421 r15203 1 reg_number,matric_number,level,code,score,mandatory,level_session 2 1,,100,COURSE1,1,True, 3 2,,100,COURSE1,2,False, 4 ,100002,100,COURSE1,3,False, 5 1,,200,COURSE1,1,True,2008 6 1,,nonsense,COURSE1,5,, 7 1,,100,NONSENSE,5,, 8 1,,200,COURSE1,6,,2004 9 1,,300,COURSE1,6,,2008 10 1,,300,COURSE1,6,,2008X 1 reg_number,matric_number,level,code,score,mandatory,level_session,ticket_session 2 1,,100,COURSE1,1,True,, 3 2,,100,COURSE1,2,False,, 4 ,100002,100,COURSE1,3,False,, 5 1,,200,COURSE1,1,True,2008, 6 1,,nonsense,COURSE1,5,,, 7 1,,100,NONSENSE,5,,, 8 1,,200,COURSE1,6,,2004, 9 1,,300,COURSE1,6,,2008, 10 1,,300,COURSE1,6,,2008X, -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_batching.py
r15163 r15203 957 957 self.assertEqual(num_warns,5) 958 958 self.assertEqual(fail_file, 959 'reg_number,code,mandatory,level,level_session, score,matric_number,--ERRORS--\r\n'960 '1,COURSE1,<IGNORE>,nonsense,<IGNORE>, 5,<IGNORE>,Not all parents do exist yet.\r\n'961 '1,NONSENSE,<IGNORE>,100,<IGNORE>, 5,<IGNORE>,code: non-existent\r\n'962 '1,COURSE1,<IGNORE>,200,2004, 6,<IGNORE>,level_session: does not match 2008\r\n'963 '1,COURSE1,<IGNORE>,300,2008, 6,<IGNORE>,level object: does not exist\r\n'964 '1,COURSE1,<IGNORE>,300,2008X, 6,<IGNORE>,level_session: Invalid value\r\n')959 'reg_number,code,mandatory,level,level_session,ticket_session,score,matric_number,--ERRORS--\r\n' 960 '1,COURSE1,<IGNORE>,nonsense,<IGNORE>,<IGNORE>,5,<IGNORE>,Not all parents do exist yet.\r\n' 961 '1,NONSENSE,<IGNORE>,100,<IGNORE>,<IGNORE>,5,<IGNORE>,code: non-existent\r\n' 962 '1,COURSE1,<IGNORE>,200,2004,<IGNORE>,6,<IGNORE>,level_session: does not match 2008\r\n' 963 '1,COURSE1,<IGNORE>,300,2008,<IGNORE>,6,<IGNORE>,level object: does not exist\r\n' 964 '1,COURSE1,<IGNORE>,300,2008X,<IGNORE>,6,<IGNORE>,level_session: Invalid value\r\n') 965 965 assert self.processor.entryExists( 966 966 dict(reg_number='1', level='100', code='COURSE1'), … … 1010 1010 self.assertEqual(num_warns,5) 1011 1011 self.assertEqual(fail_file, 1012 'reg_number,code,mandatory,level,level_session, score,matric_number,--ERRORS--\r\n'1013 '1,COURSE1,<IGNORE>,nonsense,<IGNORE>, 5,<IGNORE>,Cannot update: no such entry\r\n'1014 '1,NONSENSE,<IGNORE>,100,<IGNORE>, 5,<IGNORE>,code: non-existent\r\n'1015 '1,COURSE1,<IGNORE>,200,2004, 6,<IGNORE>,level_session: does not match 2008\r\n'1016 '1,COURSE1,<IGNORE>,300,2008, 6,<IGNORE>,level object: does not exist\r\n'1017 '1,COURSE1,<IGNORE>,300,2008X, 6,<IGNORE>,level_session: Invalid value\r\n')1012 'reg_number,code,mandatory,level,level_session,ticket_session,score,matric_number,--ERRORS--\r\n' 1013 '1,COURSE1,<IGNORE>,nonsense,<IGNORE>,<IGNORE>,5,<IGNORE>,Cannot update: no such entry\r\n' 1014 '1,NONSENSE,<IGNORE>,100,<IGNORE>,<IGNORE>,5,<IGNORE>,code: non-existent\r\n' 1015 '1,COURSE1,<IGNORE>,200,2004,<IGNORE>,6,<IGNORE>,level_session: does not match 2008\r\n' 1016 '1,COURSE1,<IGNORE>,300,2008,<IGNORE>,6,<IGNORE>,level object: does not exist\r\n' 1017 '1,COURSE1,<IGNORE>,300,2008X,<IGNORE>,6,<IGNORE>,level_session: Invalid value\r\n') 1018 1018 shutil.rmtree(os.path.dirname(fin_file)) 1019 1019 … … 1052 1052 self.assertEqual(num_warns,7) 1053 1053 self.assertEqual(fail_file, 1054 'reg_number,code,mandatory,level,level_session, score,matric_number,--ERRORS--\r\n'1055 '1,COURSE1,True,100,<IGNORE>, 1,<IGNORE>,Studycourse is locked.\r\n'1056 '1,COURSE1,True,200,2008, 1,<IGNORE>,Studycourse is locked.\r\n'1057 '1,COURSE1,<IGNORE>,nonsense,<IGNORE>, 5,<IGNORE>,Cannot update: no such entry\r\n'1058 '1,NONSENSE,<IGNORE>,100,<IGNORE>, 5,<IGNORE>,code: non-existent\r\n'1059 '1,COURSE1,<IGNORE>,200,2004, 6,<IGNORE>,level_session: does not match 2008\r\n'1060 '1,COURSE1,<IGNORE>,300,2008, 6,<IGNORE>,level object: does not exist\r\n'1061 '1,COURSE1,<IGNORE>,300,2008X, 6,<IGNORE>,level_session: Invalid value\r\n')1054 'reg_number,code,mandatory,level,level_session,ticket_session,score,matric_number,--ERRORS--\r\n' 1055 '1,COURSE1,True,100,<IGNORE>,<IGNORE>,1,<IGNORE>,Studycourse is locked.\r\n' 1056 '1,COURSE1,True,200,2008,<IGNORE>,1,<IGNORE>,Studycourse is locked.\r\n' 1057 '1,COURSE1,<IGNORE>,nonsense,<IGNORE>,<IGNORE>,5,<IGNORE>,Cannot update: no such entry\r\n' 1058 '1,NONSENSE,<IGNORE>,100,<IGNORE>,<IGNORE>,5,<IGNORE>,code: non-existent\r\n' 1059 '1,COURSE1,<IGNORE>,200,2004,<IGNORE>,6,<IGNORE>,level_session: does not match 2008\r\n' 1060 '1,COURSE1,<IGNORE>,300,2008,<IGNORE>,6,<IGNORE>,level object: does not exist\r\n' 1061 '1,COURSE1,<IGNORE>,300,2008X,<IGNORE>,6,<IGNORE>,level_session: Invalid value\r\n') 1062 1062 shutil.rmtree(os.path.dirname(fin_file)) 1063 1063 -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py
r15200 r15203 805 805 self.browser.getLink("100").click() 806 806 self.assertMatches( 807 '...: Study Level100 (Year 1)...', self.browser.contents)807 '...: 100 (Year 1)...', self.browser.contents) 808 808 self.browser.getLink("Manage").click() 809 809 self.browser.getControl(name="form.level_session").value = ['2002'] … … 888 888 self.browser.getLink("200").click() 889 889 self.assertMatches( 890 '...: Study Level200 (Year 2)...', self.browser.contents)890 '...: 200 (Year 2)...', self.browser.contents) 891 891 # Since COURSE1 has score 10 it becomes a carry-over course 892 892 # in level 200 -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_export.py
r15163 r15203 614 614 result, 615 615 'automatic,carry_over,code,course_category,credits,dcode,fcode,level,level_session,' 616 'mandatory,outstanding,passmark,score,semester,ti tle,student_id,certcode,'616 'mandatory,outstanding,passmark,score,semester,ticket_session,title,student_id,certcode,' 617 617 'display_fullname\r\n' 618 '0,0,,,,,,,,0,0,,,,,,, \r\n'618 '0,0,,,,,,,,0,0,,,,,,,,\r\n' 619 619 ) 620 620 return … … 633 633 result, 634 634 'automatic,carry_over,code,course_category,credits,dcode,fcode,level,level_session,' 635 'mandatory,outstanding,passmark,score,semester,ti tle,student_id,certcode,'635 'mandatory,outstanding,passmark,score,semester,ticket_session,title,student_id,certcode,' 636 636 'display_fullname\r\n' 637 '1,1,CRS1,,100,DEP1,FAC1,100,2012,0,0,100,,2, Course 1,A111111,CERT1,'637 '1,1,CRS1,,100,DEP1,FAC1,100,2012,0,0,100,,2,,Course 1,A111111,CERT1,' 638 638 'Anna M. Tester\r\n' 639 639 ) … … 650 650 result, 651 651 'automatic,carry_over,code,course_category,credits,dcode,fcode,level,level_session,' 652 'mandatory,outstanding,passmark,score,semester,ti tle,student_id,certcode,'652 'mandatory,outstanding,passmark,score,semester,ticket_session,title,student_id,certcode,' 653 653 'display_fullname\r\n' 654 '1,1,CRS1,,100,DEP1,FAC1,100,2012,0,0,100,,2, Course 1,A111111,CERT1,'654 '1,1,CRS1,,100,DEP1,FAC1,100,2012,0,0,100,,2,,Course 1,A111111,CERT1,' 655 655 'Anna M. Tester\r\n' 656 656 ) … … 666 666 result, 667 667 'automatic,carry_over,code,course_category,credits,dcode,fcode,level,level_session,' 668 'mandatory,outstanding,passmark,score,semester,ti tle,student_id,certcode,'668 'mandatory,outstanding,passmark,score,semester,ticket_session,title,student_id,certcode,' 669 669 'display_fullname\r\n' 670 '1,1,CRS1,,100,DEP1,FAC1,100,2012,0,0,100,,2, Course 1,A111111,CERT1,'670 '1,1,CRS1,,100,DEP1,FAC1,100,2012,0,0,100,,2,,Course 1,A111111,CERT1,' 671 671 'Anna M. Tester\r\n' 672 672 ) … … 685 685 result, 686 686 'automatic,carry_over,code,course_category,credits,dcode,fcode,level,level_session,' 687 'mandatory,outstanding,passmark,score,semester,ti tle,student_id,certcode,'687 'mandatory,outstanding,passmark,score,semester,ticket_session,title,student_id,certcode,' 688 688 'display_fullname\r\n' 689 '1,1,CRS1,,100,DEP1,FAC1,100,2012,0,0,100,,2, Course 1,A111111,CERT1,'689 '1,1,CRS1,,100,DEP1,FAC1,100,2012,0,0,100,,2,,Course 1,A111111,CERT1,' 690 690 'Anna M. Tester\r\n' 691 691 ) … … 699 699 result, 700 700 'automatic,carry_over,code,course_category,credits,dcode,fcode,level,level_session,' 701 'mandatory,outstanding,passmark,score,semester,ti tle,student_id,certcode,'701 'mandatory,outstanding,passmark,score,semester,ticket_session,title,student_id,certcode,' 702 702 'display_fullname\r\n' 703 '1,1,CRS1,,100,DEP1,FAC1,100,2012,0,0,100,,2, Course 1,A111111,CERT1,'703 '1,1,CRS1,,100,DEP1,FAC1,100,2012,0,0,100,,2,,Course 1,A111111,CERT1,' 704 704 'Anna M. Tester\r\n' 705 705 ) … … 712 712 result, 713 713 'automatic,carry_over,code,course_category,credits,dcode,fcode,level,level_session,' 714 'mandatory,outstanding,passmark,score,semester,ti tle,student_id,certcode,'714 'mandatory,outstanding,passmark,score,semester,ticket_session,title,student_id,certcode,' 715 715 'display_fullname\r\n' 716 '1,1,CRS1,,100,DEP1,FAC1,100,2012,0,0,100,,2, Course 1,A111111,CERT1,'716 '1,1,CRS1,,100,DEP1,FAC1,100,2012,0,0,100,,2,,Course 1,A111111,CERT1,' 717 717 'Anna M. Tester\r\n' 718 718 ) … … 724 724 result, 725 725 'automatic,carry_over,code,course_category,credits,dcode,fcode,level,level_session,' 726 'mandatory,outstanding,passmark,score,semester,ti tle,student_id,certcode,'726 'mandatory,outstanding,passmark,score,semester,ticket_session,title,student_id,certcode,' 727 727 'display_fullname\r\n' 728 728 ) … … 735 735 result, 736 736 'automatic,carry_over,code,course_category,credits,dcode,fcode,level,level_session,' 737 'mandatory,outstanding,passmark,score,semester,ti tle,student_id,certcode,'737 'mandatory,outstanding,passmark,score,semester,ticket_session,title,student_id,certcode,' 738 738 'display_fullname\r\n' 739 739 ) … … 747 747 result, 748 748 'automatic,carry_over,code,course_category,credits,dcode,fcode,level,level_session,' 749 'mandatory,outstanding,passmark,score,semester,ti tle,student_id,certcode,'749 'mandatory,outstanding,passmark,score,semester,ticket_session,title,student_id,certcode,' 750 750 'display_fullname\r\n' 751 '1,1,CRS1,,100,DEP1,FAC1,100,2012,0,0,100,,2, Course 1,A111111,CERT1,'751 '1,1,CRS1,,100,DEP1,FAC1,100,2012,0,0,100,,2,,Course 1,A111111,CERT1,' 752 752 'Anna M. Tester\r\n' 753 753 ) … … 758 758 result, 759 759 'automatic,carry_over,code,course_category,credits,dcode,fcode,level,level_session,' 760 'mandatory,outstanding,passmark,score,semester,ti tle,student_id,certcode,'760 'mandatory,outstanding,passmark,score,semester,ticket_session,title,student_id,certcode,' 761 761 'display_fullname\r\n' 762 762 ) … … 771 771 result, 772 772 'automatic,carry_over,code,course_category,credits,dcode,fcode,level,level_session,' 773 'mandatory,outstanding,passmark,score,semester,ti tle,student_id,certcode,'773 'mandatory,outstanding,passmark,score,semester,ticket_session,title,student_id,certcode,' 774 774 'display_fullname\r\n' 775 '1,1,CRS1,,100,DEP1,FAC1,110,2012,0,0,100,,2, Course 1,A111111,CERT1,'775 '1,1,CRS1,,100,DEP1,FAC1,110,2012,0,0,100,,2,,Course 1,A111111,CERT1,' 776 776 'Anna M. Tester\r\n' 777 777 ) … … 1345 1345 'student_id,state,certcode,faccode,depcode,is_postgrad,' 1346 1346 'entry_session,current_level,current_session,' 1347 ' 10,100,110,120,200,210,220,300,310,320,400,410,420,500,'1347 '0,10,100,110,120,200,210,220,300,310,320,400,410,420,500,' 1348 1348 '510,520,600,610,620,700,710,720,800,810,820,900,910,920,999\r\n' 1349 'A111111,created,CERT1,NA,NA,0,2010,200,2012,, 2012'1349 'A111111,created,CERT1,NA,NA,0,2010,200,2012,,,2012' 1350 1350 ',,,,,,,,,,,,,,,,,,,,,,,,,,,\r\n', 1351 1351 result … … 1361 1361 'student_id,state,certcode,faccode,depcode,is_postgrad,' 1362 1362 'entry_session,current_level,current_session,' 1363 ' 10,100,110,120,200,210,220,300,310,320,400,410,420,500,'1363 '0,10,100,110,120,200,210,220,300,310,320,400,410,420,500,' 1364 1364 '510,520,600,610,620,700,710,720,800,810,820,900,910,920,999\r\n' 1365 'A111111,created,CERT1,NA,NA,0,2010,200,2012,, 2012'1365 'A111111,created,CERT1,NA,NA,0,2010,200,2012,,,2012' 1366 1366 ',,,,,,,,,,,,,,,,,,,,,,,,,,,\r\n', 1367 1367 result -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_vocabularies.py
r9778 r15203 65 65 studylevelsource = StudyLevelSource().factory 66 66 values = studylevelsource.getValues(studycourse) 67 self.assertEqual(values, [ 100, 110, 120, 200, 210, 220, 300, 310, 320,67 self.assertEqual(values, [0, 100, 110, 120, 200, 210, 220, 300, 310, 320, 68 68 400, 410, 420, 500, 510, 520, 600, 610, 620]) 69 69 # All titles do exist 70 70 titles = [studylevelsource.getTitle(studycourse, value) 71 71 for value in values] 72 self.assertEqual(len(titles), 1 8)72 self.assertEqual(len(titles), 19) 73 73 # Unfortunately, unittests don't know about internationalization 74 74 self.assertEqual(studylevelsource.getTitle(studycourse, None), 75 75 'Error: level id ${value} out of range') 76 76 self.assertEqual(studylevelsource.getTitle(studycourse, 0), 77 'Level Zero') 78 self.assertEqual(studylevelsource.getTitle(studycourse, 1), 77 79 'Error: level id ${value} out of range') 78 80 self.assertEqual(studylevelsource.getTitle(studycourse, 10), … … 96 98 self.assertEqual(studylevelsource.getTitle(studycourse, 700), 97 99 'Error: level id ${value} out of range') 98 # Now we modify the certificates to be a pure topre-studies100 # Now we modify the certificates to be a pure pre-studies 99 101 # course 100 102 studycourse.certificate.start_level = 10 101 103 studycourse.certificate.end_level = 10 102 104 values = studylevelsource.getValues(studycourse) 103 self.assertEqual(values, [ 10])105 self.assertEqual(values, [0, 10]) 104 106 titles = [studylevelsource.getTitle(studycourse, value) 105 107 for value in values] 106 self.assertEqual(len(titles), 1)108 self.assertEqual(len(titles), 2) 107 109 self.assertEqual(studylevelsource.getTitle(studycourse, 10), 108 110 'Pre-Studies') … … 115 117 studycourse.certificate.end_level = 200 116 118 values = studylevelsource.getValues(studycourse) 117 self.assertEqual(values, [ 10, 100, 110, 120,119 self.assertEqual(values, [0, 10, 100, 110, 120, 118 120 200, 210, 220, 300, 310, 320]) 119 121 titles = [studylevelsource.getTitle(studycourse, value) 120 122 for value in values] 121 self.assertEqual(len(titles), 1 0)123 self.assertEqual(len(titles), 11) 122 124 # Repeating Pre-Studies level does not exist and raises a KeyError 123 125 # when trying to get its title -
main/waeup.kofa/trunk/src/waeup/kofa/students/utils.py
r15200 r15203 263 263 headerline = [] 264 264 tabledata = [] 265 subheader = '%s %s, %s %s' % ( 266 trans(_('Session'), lang), 267 view.session_dict[level_obj.level_session], 268 trans(_('Level'), lang), 269 view.level_dict[level_obj.level]) 265 if 'evel' in view.level_dict.get('ticket.level', str(level_obj.level)): 266 subheader = '%s %s, %s' % ( 267 trans(_('Session'), lang), 268 view.session_dict[level_obj.level_session], 269 view.level_dict.get('ticket.level', str(level_obj.level))) 270 else: 271 subheader = '%s %s, %s %s' % ( 272 trans(_('Session'), lang), 273 view.session_dict[level_obj.level_session], 274 trans(_('Level'), lang), 275 view.level_dict.get('ticket.level', str(level_obj.level))) 270 276 data.append(Paragraph(subheader, HEADING_STYLE)) 271 277 for element in tableheader: -
main/waeup.kofa/trunk/src/waeup/kofa/students/vocabularies.py
r14480 r15203 69 69 start_level = int(certificate.start_level) 70 70 end_level = int(certificate.end_level) 71 return levels_from_range(start_level, end_level)71 return [0,] + levels_from_range(start_level, end_level) 72 72 73 73 class StudyLevelSource(BasicContextualSourceFactory): … … 77 77 first spillover level by the certificate's end level plus 100 78 78 and the second spillover level by the end level plus 110. 79 The level zero contains all courses without level 80 affiliation. 79 81 """ 80 82 def getValues(self, context): … … 105 107 if value == 999: 106 108 return course_levels.by_value[999].title 109 if value == 0: 110 return _('Level Zero') 107 111 if start_level == 10 and end_level == 10 and value != 10: 108 112 return _('Error: level id ${value} out of range',
Note: See TracChangeset for help on using the changeset viewer.