Changeset 17640 for main/waeup.kofa/trunk/src/waeup/kofa/students
- Timestamp:
- 13 Nov 2023, 08:46:45 (14 months ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa/students
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/students/browser_templates/exportselected.pt
r14452 r17640 1 1 <p i18n:translate=""> 2 2 Here you can export student data for a small subset of students by entering 3 a list of student ids or matric numbers.3 a list of student ids, matric numbers or ids of payments made by students. 4 4 The values must be separated by whitespaces or commas. 5 5 You can also copy and paste parts of Excel or Calc columns. … … 18 18 <br /> 19 19 <label for="mode" i18n:translate=""> 20 Student Ids or Matric Numbers20 Student Ids, Matric Numbers or Payment Ids 21 21 </label> 22 22 <input name="students" type="text" class="form-control" id="students" -
main/waeup.kofa/trunk/src/waeup/kofa/students/export.py
r17557 r17640 23 23 from datetime import datetime, timedelta 24 24 from zope.component import getUtility 25 from zope.catalog.interfaces import ICatalog 25 26 from waeup.kofa.interfaces import ( 26 27 IExtFileStore, IFileStoreNameChooser, IKofaUtils) … … 302 303 if result: 303 304 student = result[0] 304 else: 305 continue 306 students.append(student) 305 if student is None: 306 # try p_id (requested by AAUE) 307 cat = getUtility(ICatalog, name='payments_catalog') 308 results = list(cat.searchResults(p_id=(id, id))) 309 if results: 310 # Check if payer is a student 311 student = getattr(results[0], 'student') 312 if student is not None: 313 students.append(student) 307 314 return students 308 315 -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_export.py
r16831 r17640 525 525 return 526 526 527 def test_export_selected_pid(self): 528 # we can export a filtered set of students (filtered by session/level) 529 self.setup_student(self.student) 530 self.app['students'].addStudent(self.student) 531 notify(grok.ObjectModifiedEvent(self.student)) 532 exporter = StudentStudyCourseExporter() 533 exporter.export_selected( 534 self.app, self.outfile, selected=[self.payment.p_id]) 535 result = open(self.outfile, 'rb').read() 536 self.assertEqual( 537 result, 538 'certificate,current_level,current_session,current_verdict,' 539 'entry_mode,entry_session,previous_verdict,student_id,previous\r\n' 540 541 'CERT1,200,2012,0,ug_ft,2010,0,A111111,0\r\n' 542 ) 543 return 544 527 545 class PreviousStudyCourseExporterTests(StudentImportExportSetup): 528 546
Note: See TracChangeset for help on using the changeset viewer.