Ignore:
Timestamp:
15 Mar 2022, 10:57:02 (3 years ago)
Author:
Henrik Bettermann
Message:

Implement TranscriptApplicantExporter?.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.uniben/trunk/src/waeup/uniben/applicants/export.py

    r16856 r16885  
    7878
    7979class FrenchApplicantExporter(CustomApplicantExporter):
    80     """Exporter for Nigeria Applicants.
     80    """
    8181    """
    8282
     
    9898                self.write_item(applicant, writer)
    9999        return self.close_outfile(filepath, outfile)
     100
     101class TranscriptApplicantExporter(CustomApplicantExporter):
     102    """
     103    """
     104
     105    grok.name('tsc_applicants')
     106    title = 'Transcript Applicants'
     107
     108    fields = tuple(sorted(set(
     109        iface_names(ITranscriptApplicant)
     110        ))) + (
     111        'password', 'state', 'history', 'container_code', 'application_number',
     112        'display_fullname', 'application_date')
     113
     114    def export(self, applicants, filepath=None):
     115        """Exports tsc applicants only
     116        """
     117        writer, outfile = self.get_csv_writer(filepath)
     118        for applicant in applicants:
     119            if applicant.__parent__.code.startswith('tsc'):
     120                self.write_item(applicant, writer)
     121        return self.close_outfile(filepath, outfile)
Note: See TracChangeset for help on using the changeset viewer.