Ignore:
Timestamp:
25 Aug 2016, 21:22:30 (8 years ago)
Author:
Henrik Bettermann
Message:

Export school names.

Location:
main/waeup.fceokene/trunk/src/waeup/fceokene/applicants
Files:
2 edited

Legend:

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

    r13981 r14131  
    2525from waeup.fceokene.applicants.interfaces import (
    2626    ICustomUGApplicant, ITPURegistration)
     27from waeup.fceokene.applicants.schools import SCHOOLS
    2728
    2829class CustomApplicantExporter(NigeriaApplicantExporter):
     
    3738        ))) + (
    3839        'password', 'state', 'history', 'container_code', 'application_number',
    39         'display_fullname', 'application_date')
     40        'display_fullname', 'application_date',
     41        'school_name1', 'school_name2', 'school_name3')
     42
     43    def mangle_value(self, value, name, context=None):
     44        """The mangler determines the codes of the atributes `course1`,
     45        `course2` and `course_admitted`. It furthermore prepares the
     46        history messages and adds a hash symbol at the end of the phone number
     47        to avoid annoying automatic number transformation by Excel or Calc.
     48        """
     49        if name.startswith('school_name'):
     50            value = getattr(context, name.replace('_name', ''))
     51            if value:
     52                value = '%s - %s - %s' % (
     53                    SCHOOLS[value][0], SCHOOLS[value][1], SCHOOLS[value][2])
     54        return super(
     55            CustomApplicantExporter, self).mangle_value(
     56            value, name, context=context)
  • main/waeup.fceokene/trunk/src/waeup/fceokene/applicants/schools.py

    r14108 r14131  
    1111    's0100': ('Zone 01','Otite, Ogaminana, Obangede','Cedio International Academy Nagazi-Eba'),
    1212    's0110': ('Zone 01','Otite, Ogaminana, Obangede','Champion Group Of Schools (Pry Section),, Eika Adagu'),
    13     's0120': ('Zone 01','Otite, Ogaminana, Obangede','Champion Group Of Schools (Secondary Section),'),
     13    's0120': ('Zone 01','Otite, Ogaminana, Obangede','Champion Group Of Schools (Secondary Section)'),
    1414    's0130': ('Zone 01','Otite, Ogaminana, Obangede','Christ The Redeemer Nursery And Primary School Otite'),
    1515    's0140': ('Zone 01','Otite, Ogaminana, Obangede','Community Secondary School, Obangede'),
Note: See TracChangeset for help on using the changeset viewer.