Ignore:
Timestamp:
10 Mar 2023, 09:39:10 (22 months ago)
Author:
Henrik Bettermann
Message:

Add new field also to importer.

Location:
main/kofacustom.edocons/trunk/src/kofacustom/edocons/students
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/kofacustom.edocons/trunk/src/kofacustom/edocons/students/batching.py

    r16639 r17346  
    1919"""
    2020from kofacustom.nigeria.students.batching import NigeriaStudentProcessor
    21 from waeup.kofa.students.batching import StudentOnlinePaymentProcessor
     21from waeup.kofa.students.batching import (
     22    StudentOnlinePaymentProcessor,
     23    CourseTicketProcessor)
    2224from kofacustom.edocons.students.interfaces import (
    2325    ICustomStudent,
    2426    ICustomStudentUpdateByRegNo,
    2527    ICustomStudentUpdateByMatricNo,
    26     ICustomStudentOnlinePayment
     28    ICustomStudentOnlinePayment,
     29    ICustomCourseTicketImport
    2730    )
    2831
     
    3841    """
    3942    iface = ICustomStudentOnlinePayment
     43
     44class CustomCourseTicketProcessor(CourseTicketProcessor):
     45    """A batch processor for ICourseTicket objects.
     46    """
     47    iface = ICustomCourseTicketImport
     48
     49    @property
     50    def available_fields(self):
     51        fields = [
     52            'student_id','reg_number','matric_number',
     53            'mandatory', 'score', 'carry_over', 'automatic',
     54            'outstanding', 'course_category', 'level_session',
     55            'title', 'credits', 'passmark', 'semester', 'ticket_session',
     56            'unlock_score', 'previous', 'carryover_score',
     57            ] + self.additional_fields
     58        return sorted(fields)
  • main/kofacustom.edocons/trunk/src/kofacustom/edocons/students/interfaces.py

    r17345 r17346  
    1919from zope import schema
    2020from waeup.kofa.students.vocabularies import StudyLevelSource
     21from waeup.kofa.interfaces import (IKofaObject, academic_sessions_vocab)
    2122from kofacustom.nigeria.students.interfaces import (
    2223    INigeriaStudentBase, INigeriaUGStudentClearance, INigeriaPGStudentClearance,
     
    102103ICustomCourseTicket['carryover_score'].order = ICustomCourseTicket['carry_over'].order
    103104
     105class ICustomCourseTicketImport(ICustomCourseTicket):
     106    """An interface for importing course results and nothing more.
     107    """
     108
     109    score = schema.Int(
     110        title = _(u'Score'),
     111        required = False,
     112        readonly = False,
     113        )
     114
     115    level_session = schema.Choice(
     116        title = _(u'Level Session'),
     117        source = academic_sessions_vocab,
     118        required = False,
     119        readonly = False,
     120        )
     121
     122    carryover_score = schema.Int(
     123        title = _(u'Carry-over Score'),
     124        default = None,
     125        required = False,
     126        missing_value = None,
     127        max = 100,
     128        )
     129
    104130class ICustomStudentUpdateByRegNo(INigeriaStudentUpdateByRegNo):
    105131    """Representation of a student. Skip regular reg_number validation.
Note: See TracChangeset for help on using the changeset viewer.