Ignore:
Timestamp:
8 Jul 2024, 15:48:12 (4 months ago)
Author:
Henrik Bettermann
Message:

Improve NYSCExporter.

File:
1 edited

Legend:

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

    r17831 r17834  
    194194        'date_of_birth',
    195195        'state',
     196        'lg_state',
     197        'lg_area',
    196198        'current_mode',
    197199        'certcode',
     
    217219                students.append(student)
    218220        return students
     221
     222    def mangle_value(self, value, name, context=None):
     223        if name == 'lg_state' and context.lga:
     224            value = context.lga.split('_')[0]
     225        if name == 'lg_area' and context.lga:
     226            value = '-'.join(context.lga.split('_')[1:])
     227        return super(
     228            NYSCExporter, self).mangle_value(
     229            value, name, context=context)
Note: See TracChangeset for help on using the changeset viewer.