Changeset 16690


Ignore:
Timestamp:
29 Oct 2021, 17:19:52 (3 years ago)
Author:
Henrik Bettermann
Message:

Export codes.

File:
1 edited

Legend:

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

    r15516 r16690  
    4242        ))) + (
    4343        'password', 'state', 'history', 'container_code', 'application_number',
    44         'display_fullname', 'application_date')
     44        'display_fullname', 'application_date', 'faculty', 'department')
     45
     46    def mangle_value(self, value, name, context=None):
     47        """
     48        """
     49        if name == 'certificate' and value is not None:
     50            value = value.code
     51        if name == 'department':
     52            cert = getattr(context, 'certificate')
     53            if cert is not None:
     54                value = cert.__parent__.__parent__.code
     55        if name == 'faculty':
     56            cert = getattr(context, 'certificate')
     57            if cert is not None:
     58                value = cert.__parent__.__parent__.__parent__.code
     59        return super(
     60            CustomApplicantExporter, self).mangle_value(
     61            value, name, context=context)
    4562
    4663class CustomApplicantPaymentExporter(ApplicantPaymentExporter):
Note: See TracChangeset for help on using the changeset viewer.