Changeset 14189 for main


Ignore:
Timestamp:
26 Sep 2016, 10:38:29 (8 years ago)
Author:
Henrik Bettermann
Message:

Make 'title', 'credits', 'passmark' and 'semester' importable.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/students/batching.py

    r14053 r14189  
    632632    In create mode `fcode`, `dcode`, `title`, `credits`, `passmark` and
    633633    `semester` are taken from the course found in the academic section.
    634     These attributes can nevermore be changed, neither via the user interface
    635     nor by import.
     634    `fcode` and `dcode` can nevermore be changed, neither via the user interface
     635    nor by import. 'title', 'credits', 'passmark' and 'semester' can be
     636    overwritten by import.
    636637    """
    637638    grok.implements(IBatchProcessor)
     
    653654            'student_id','reg_number','matric_number',
    654655            'mandatory', 'score', 'carry_over', 'automatic',
    655             'level_session'
     656            'level_session',
     657            'title', 'credits', 'passmark', 'semester'
    656658            ] + self.additional_fields
    657659        return sorted(fields)
     
    687689        obj.fcode = entries[0].__parent__.__parent__.__parent__.code
    688690        obj.dcode = entries[0].__parent__.__parent__.code
    689         obj.title = entries[0].title
    690         #if getattr(obj, 'credits', None) is None:
    691         obj.credits = entries[0].credits
    692         #if getattr(obj, 'passmark', None) is None:
    693         obj.passmark = entries[0].passmark
    694         obj.semester = entries[0].semester
     691        if getattr(obj, 'title', None) is None:
     692            obj.title = entries[0].title
     693        if getattr(obj, 'credits', None) is None:
     694            obj.credits = entries[0].credits
     695        if getattr(obj, 'passmark', None) is None:
     696            obj.passmark = entries[0].passmark
     697        if getattr(obj, 'semester', None) is None:
     698            obj.semester = entries[0].semester
    695699        parent[row['code']] = obj
    696700        return
Note: See TracChangeset for help on using the changeset viewer.