Ignore:
Timestamp:
1 Dec 2022, 11:18:19 (2 years ago)
Author:
Henrik Bettermann
Message:

Export real names.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/kofacustom.lpng/trunk/src/kofacustom/lpng/applicants/export.py

    r16997 r17197  
    2323from kofacustom.nigeria.applicants.export import NigeriaApplicantExporter
    2424from kofacustom.lpng.applicants.interfaces import (
    25     ICustomApplicant,)
     25    ICustomApplicant, STATES, LGAS, WARDS, PUNITS)
    2626
    2727class CustomApplicantExporter(NigeriaApplicantExporter):
     
    3535        'password', 'state', 'history', 'container_code', 'application_number',
    3636        'display_fullname', 'application_date')
     37
     38    def mangle_value(self, value, name, context=None):
     39        """The mangler determines the codes of the atributes `course1`,
     40        `course2` and `course_admitted`. It furthermore prepares the
     41        history messages and adds a hash symbol at the end of the phone number
     42        to avoid annoying automatic number transformation by Excel or Calc.
     43        """
     44        if name == 'federalstate':
     45            value = STATES[value]
     46        if name == 'lga':
     47            value = LGAS[value]
     48        if name == 'ward':
     49            value = WARDS[value]
     50        if name == 'punit':
     51            value = PUNITS[value]
     52        return super(
     53            CustomApplicantExporter, self).mangle_value(
     54            value, name, context=context)
Note: See TracChangeset for help on using the changeset viewer.