Changeset 9937 for main/waeup.kofa/trunk/src/waeup/kofa/students/export.py
- Timestamp:
- 7 Feb 2013, 09:51:37 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/students/export.py
r9936 r9937 18 18 """Exporters for student related stuff. 19 19 """ 20 import os 20 21 import grok 21 22 from datetime import datetime 23 from zope.component import getUtility 24 from waeup.kofa.interfaces import IExtFileStore, IFileStoreNameChooser 22 25 from waeup.kofa.interfaces import MessageFactory as _ 23 26 from waeup.kofa.students.catalog import StudentsQuery, CourseTicketsQuery … … 402 405 #: Fieldnames considered by this exporter 403 406 fields = ('display_fullname', 404 ' matric_number',405 'certificate', 'faculty', 'department' )407 'student_id','matric_number', 408 'certificate', 'faculty', 'department', 'passport_path') 406 409 407 410 #: The title under which this exporter will be displayed … … 416 419 if name == 'faculty' and certificate is not None: 417 420 value = certificate.__parent__.__parent__.__parent__.longtitle() 421 if name == 'passport_path' and certificate is not None: 422 file_id = IFileStoreNameChooser(context).chooseName(attr='passport.jpg') 423 os_path = getUtility(IExtFileStore)._pathFromFileID(file_id) 424 if not os.path.exists(os_path): 425 value = None 426 else: 427 value = '/'.join(os_path.split('/')[-4:]) 418 428 return super( 419 429 ComboCardDataExporter, self).mangle_value(
Note: See TracChangeset for help on using the changeset viewer.