Changeset 15546 for main/waeup.kofa/trunk/src/waeup
- Timestamp:
- 16 Aug 2019, 12:40:20 (5 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa/students
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py
r15545 r15546 3773 3773 return 3774 3774 3775 def _set_semesters_values(self): 3776 utils = getUtility(IKofaUtils) 3777 self.semesters =[(_('All Semesters'), 'all')] 3778 self.semesters += sorted([(value, key) for key, value in 3779 utils.SEMESTER_DICT.items()]) 3780 return 3781 3775 3782 def _set_mode_values(self): 3776 3783 utils = getUtility(IKofaUtils) … … 3833 3840 def update(self, START=None, session=None, level=None, mode=None, 3834 3841 payments_start=None, payments_end=None, ct_level=None, 3835 ct_session=None, paycat=None, paysession=None, exporter=None): 3842 ct_session=None, ct_semester=None, paycat=None, 3843 paysession=None, exporter=None): 3836 3844 self._set_session_values() 3837 3845 self._set_level_values() … … 3839 3847 self._set_paycat_values() 3840 3848 self._set_exporter_values() 3849 self._set_semesters_values() 3841 3850 if START is None: 3842 3851 return … … 3875 3884 ct_level = ct_level, 3876 3885 ct_session = ct_session, 3886 ct_semester = ct_semester, 3877 3887 ) 3878 3888 else: … … 3890 3900 paysession=paysession, 3891 3901 ct_level = ct_level, 3892 ct_session = ct_session,) 3902 ct_session = ct_session, 3903 ct_semester = ct_semester,) 3893 3904 ob_class = self.__implemented__.__name__.replace('waeup.kofa.','') 3894 3905 self.context.logger.info( -
main/waeup.kofa/trunk/src/waeup/kofa/students/browser_templates/exportconfig.pt
r15315 r15546 117 117 </select> 118 118 <br /> 119 <label for="semester" i18n:translate=""> 120 Course Ticket Semester 121 </label> 122 <select name="ct_semester" class="form-control half"> 123 <option tal:repeat="item view/semesters" 124 tal:attributes="value python:item[1]"> 125 <span tal:replace="python: item[0]">1st Semester</span> 126 </option> 127 </select> 128 <br /> 119 129 </span> 120 130 -
main/waeup.kofa/trunk/src/waeup/kofa/students/export.py
r15297 r15546 59 59 which belong to this course code and meet level=level 60 60 and level_session=level_session. 61 If not, but ct_level and ct_session61 If not, but ct_level, ct_session and ct_semester 62 62 are passed through, filter course tickets 63 which meet level==ct_level and level_session==ct_session. 63 which meet level==ct_level, level_session==ct_session 64 and semester==ct_semester. 64 65 """ 65 66 tickets = [] … … 69 70 ct_level = kw.get('ct_level', None) 70 71 ct_session = kw.get('ct_session', None) 72 ct_semester = kw.get('ct_semester', None) 71 73 if code is None: 72 74 for level_obj in get_levels(students): … … 81 83 if ct_session not in ('all', None) and \ 82 84 int(ct_session) != level_obj.level_session: 85 continue 86 if ct_semester not in ('all', None) and \ 87 int(ct_semester) != ticket.semester: 83 88 continue 84 89 tickets.append(ticket) … … 219 224 del kw['ct_level'] 220 225 del kw['ct_session'] 226 del kw['ct_semester'] 221 227 except KeyError: 222 228 pass -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_export.py
r15333 r15546 690 690 'Anna M. Tester\r\n' 691 691 ) 692 # We can set the course tickets level and level_session without code693 # (used in the datacenter)692 # We can set the course tickets level, semester and level_session 693 # without code (used in the datacenter) 694 694 notify(grok.ObjectModifiedEvent(self.student['studycourse']['100']['CRS1'])) 695 695 exporter.export_filtered(self.student, self.outfile, ct_level='100', 696 ct_session='2012' )696 ct_session='2012', ct_semester='2') 697 697 result = open(self.outfile, 'rb').read() 698 698 self.assertEqual( … … 707 707 notify(grok.ObjectModifiedEvent(self.student['studycourse']['100']['CRS1'])) 708 708 exporter.export_filtered(self.student, self.outfile, ct_level='all', 709 ct_session='2012' )709 ct_session='2012', ct_semester='all') 710 710 result = open(self.outfile, 'rb').read() 711 711 self.assertEqual( … … 731 731 exporter.export_filtered(self.student, self.outfile, 732 732 ct_level='all', ct_session='2013') 733 result = open(self.outfile, 'rb').read() 734 self.assertEqual( 735 result, 736 'automatic,carry_over,code,course_category,credits,dcode,fcode,level,level_session,' 737 'mandatory,outstanding,passmark,score,semester,ticket_session,title,student_id,certcode,' 738 'display_fullname\r\n' 739 ) 740 # 1st semester tickets do not exist. 741 notify(grok.ObjectModifiedEvent(self.student['studycourse']['100']['CRS1'])) 742 exporter.export_filtered(self.student, self.outfile, 743 ct_level='all', ct_session='all', ct_semester='1') 733 744 result = open(self.outfile, 'rb').read() 734 745 self.assertEqual(
Note: See TracChangeset for help on using the changeset viewer.