- Timestamp:
- 13 Jan 2020, 23:51:00 (5 years ago)
- Location:
- main/waeup.kofa/trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/CHANGES.txt
r15918 r15920 4 4 1.6.1.dev0 (unreleased) 5 5 ======================= 6 7 * Add `TranscriptDataExporter` and reorganize exporter names. 6 8 7 9 * Add `session_level`filter to `StudentStudyLevelExporter`. -
main/waeup.kofa/trunk/src/waeup/kofa/students/browser_templates/exportconfig.pt
r15918 r15920 155 155 document.getElementById('exporter').value == 'studentpayments' || 156 156 document.getElementById('exporter').value == 'accommodationpayments' || 157 document.getElementById('exporter').value == ' studentunpaidpayments') {157 document.getElementById('exporter').value == 'unpaidpayments') { 158 158 document.getElementById('payment_dates').style.display = 'block'; 159 159 document.getElementById('paycat').style.display = 'block'; -
main/waeup.kofa/trunk/src/waeup/kofa/students/export.py
r15918 r15920 329 329 'password', 'state', 'history', 'certcode', 'is_postgrad', 330 330 'current_level', 'current_session') 331 title = _(u'Students ')331 title = _(u'Students (Data Backup)') 332 332 333 333 def mangle_value(self, value, name, context=None): … … 355 355 356 356 fields = tuple(sorted(iface_names(IStudentStudyCourse))) + ('student_id',) 357 title = _(u'Student Study Courses ')357 title = _(u'Student Study Courses (Data Backup)') 358 358 359 359 def filter_func(self, x, **kw): … … 386 386 IStudentStudyLevel))) + ( 387 387 'student_id', 'number_of_tickets','certcode') 388 title = _(u'Student Study Levels ')388 title = _(u'Student Study Levels (Data Backup)') 389 389 390 390 def filter_func(self, x, **kw): … … 420 420 ['level', 'code', 'level_session'])) + ('student_id', 421 421 'certcode', 'display_fullname') 422 title = _(u'Course Tickets ')422 title = _(u'Course Tickets (Data Backup)') 423 423 424 424 def filter_func(self, x, **kw): … … 474 474 or nottaken (registered but not taken). 475 475 """ 476 grok.name(' studentoutstandingcourses')476 grok.name('outstandingcourses') 477 477 478 478 fields = ('student_id', 'certcode', 'display_fullname','missed', 479 479 'failed', 'nottaken') 480 title = _(u' StudentOutstanding Courses')480 title = _(u'Outstanding Courses') 481 481 482 482 def filter_func(self, x, **kw): … … 514 514 omit=['display_item', 'certificate', 'student']))) + ( 515 515 'student_id','state','current_session') 516 title = _(u'Student Payments ')516 title = _(u'Student Payments (Data Backup)') 517 517 518 518 def filter_func(self, x, **kw): … … 538 538 payment ticket. 539 539 """ 540 grok.name(' studentunpaidpayments')541 542 title = _(u' Student Unpaid Payments')540 grok.name('unpaidpayments') 541 542 title = _(u'Unpaid Payment Tickets') 543 543 544 544 def filter_func(self, x, **kw): … … 618 618 omit=['display_coordinates', 'maint_payment_made']))) + ( 619 619 'student_id', 'actual_bed_type') 620 title = _(u'Bed Tickets ')620 title = _(u'Bed Tickets (Data Backup)') 621 621 622 622 def filter_func(self, x, **kw): … … 655 655 'entry_session', 'reg_number' 656 656 ) + year_range_tuple 657 title = _(u'S tudent School Fee Payments Overview')657 title = _(u'School Fee Payments Overview') 658 658 659 659 def mangle_value(self, value, name, context=None): … … 768 768 'entry_session', 'current_level', 'current_session', 769 769 ) + avail_levels 770 title = _(u'Stud ent Study Levels Overview')770 title = _(u'Study Levels Overview') 771 771 772 772 def mangle_value(self, value, name, context=None): … … 823 823 ComboCardDataExporter, self).mangle_value( 824 824 value, name, context=context) 825 826 class StudentTranscriptDataExporter(StudentExporter): 827 """The Student Transcript Data Exporter first filters the set of 828 students by searching the students catalog. Then it exports student data 829 along with their transcript data. 830 """ 831 grok.name('transcriptdata') 832 833 fields = ('student_id', ) + ( 834 'state', 'certcode', 'faccode', 'depcode', 835 'entry_session', 'current_level', 'current_session', 836 'transcript_data') 837 title = _(u'Transcript Data') 838 839 def mangle_value(self, value, name, context=None): 840 """The mangler determines the trascript data. 841 """ 842 if name == 'transcript_data': 843 value = {} 844 td = context['studycourse'].getTranscriptData()[0] 845 for level in td: 846 tickets_1 = ','.join(i.code for i in level['tickets_1']) 847 tickets_2 = ','.join(i.code for i in level['tickets_2']) 848 tickets_3 = ','.join(i.code for i in level['tickets_3']) 849 value = "Level %s; 1st: %s; 2nd: %s; 3rd: %s; sgpa: %s" % ( 850 level['level_key'], tickets_1, tickets_2, 851 tickets_3, level['sgpa'], 852 ) 853 return super( 854 StudentTranscriptDataExporter, self).mangle_value( 855 value, name, context=context) -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_export.py
r15918 r15920 36 36 StudentUnpaidPaymentExporter, SessionPaymentsOverviewExporter, 37 37 StudentOutstandingCoursesExporter, 38 AccommodationPaymentsExporter, get_students,) 38 AccommodationPaymentsExporter, 39 StudentTranscriptDataExporter, 40 get_students,) 39 41 from waeup.kofa.students.accommodation import BedTicket 40 42 from waeup.kofa.students.interfaces import ICSVStudentExporter … … 813 815 def test_get_as_utility(self): 814 816 # we can get an student exporter as utility 815 result = queryUtility(ICSVExporter, name=" studentoutstandingcourses")817 result = queryUtility(ICSVExporter, name="outstandingcourses") 816 818 self.assertTrue(result is not None) 817 819 return … … 1530 1532 ) 1531 1533 return 1534 1535 class StudentTranscriptDataExporterTest(StudentImportExportSetup): 1536 1537 layer = FunctionalLayer 1538 1539 def setUp(self): 1540 super(StudentTranscriptDataExporterTest, self).setUp() 1541 self.setup_for_export() 1542 return 1543 1544 def test_export_all(self): 1545 self.setup_student(self.student) 1546 exporter = StudentTranscriptDataExporter() 1547 exporter.export_all(self.app, self.outfile) 1548 result = open(self.outfile, 'rb').read() 1549 self.assertTrue( 1550 'student_id,state,certcode,faccode,depcode,entry_session,' 1551 'current_level,current_session,transcript_data\r\n' 1552 'A111111,created,CERT1,NA,NA,2010,200,2012,' 1553 'Level 100; 1st: ; 2nd: CRS1; 3rd: ; sgpa: 0.0\r\n' 1554 in result 1555 ) 1556 return -
main/waeup.kofa/trunk/src/waeup/kofa/students/utils.py
r15889 r15920 1150 1150 #: A tuple containing all exporter names referring to students or 1151 1151 #: subobjects thereof. 1152 STUDENT_EXPORTER_NAMES = ('students', 'studentstudycourses', 1153 'studentstudylevels', 'coursetickets','studentoutstandingcourses', 1154 'studentpayments', 'studentunpaidpayments', 1155 'sfpaymentsoverview', 'sessionpaymentsoverview', 1156 'studylevelsoverview','bedtickets', 1157 'combocard', 'bursary', 1158 'accommodationpayments',) 1152 STUDENT_EXPORTER_NAMES = ( 1153 'students', 1154 'studentstudycourses', 1155 'studentstudylevels', 1156 'coursetickets', 1157 'studentpayments', 1158 'bedtickets', 1159 'outstandingcourses', 1160 'unpaidpayments', 1161 'sfpaymentsoverview', 1162 'sessionpaymentsoverview', 1163 'studylevelsoverview', 1164 'combocard', 1165 'bursary', 1166 'accommodationpayments', 1167 'transcriptdata') 1159 1168 1160 1169 #: A tuple containing all exporter names needed for backing
Note: See TracChangeset for help on using the changeset viewer.