Changeset 13865 for main


Ignore:
Timestamp:
26 May 2016, 13:44:09 (9 years ago)
Author:
Henrik Bettermann
Message:

Customize Course Ticket Processor.

Location:
main/waeup.aaue/trunk/src/waeup/aaue/students
Files:
2 edited

Legend:

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

    r8911 r13865  
    2727    ICustomStudent, ICustomStudentUpdateByRegNo,
    2828    ICustomStudentUpdateByMatricNo,
    29     ICustomStudentOnlinePayment
     29    ICustomStudentOnlinePayment,
     30    ICustomCourseTicketImport,
    3031    )
    3132from waeup.kofa.students.batching import (
    32     StudentProcessor, StudentOnlinePaymentProcessor)
     33    StudentProcessor, StudentOnlinePaymentProcessor,
     34    CourseTicketProcessor)
    3335
    3436class CustomStudentProcessor(StudentProcessor):
     
    4345    """
    4446    iface = ICustomStudentOnlinePayment
     47
     48class CustomCourseTicketProcessor(CourseTicketProcessor):
     49    """A batch processor for ICourseTicket objects.
     50    """
     51    iface = ICustomCourseTicketImport
     52
     53    @property
     54    def available_fields(self):
     55        fields = [
     56            'student_id','reg_number','matric_number',
     57            'mandatory', 'score', 'ca', 'carry_over', 'automatic',
     58            'level_session'
     59            ] + self.additional_fields
     60        return sorted(fields)
  • main/waeup.aaue/trunk/src/waeup/aaue/students/interfaces.py

    r13834 r13865  
    2121from zope.catalog.interfaces import ICatalog
    2222from zope.component import getUtility
    23 from waeup.kofa.interfaces import IKofaObject
     23from waeup.kofa.interfaces import (IKofaObject, academic_sessions_vocab)
    2424from waeup.kofa.students.vocabularies import (
    2525    StudyLevelSource, contextual_reg_num_source
     
    310310        )
    311311
     312class ICustomCourseTicketImport(ICustomCourseTicket):
     313    """An interface for importing course results and nothing more.
     314    """
     315    score = schema.Int(
     316        title = _(u'Score'),
     317        required = False,
     318        readonly = False,
     319        )
     320
     321    ca = schema.Int(
     322        title = _(u'CA'),
     323        required = False,
     324        readonly = False,
     325        )
     326
     327    level_session = schema.Choice(
     328        title = _(u'Level Session'),
     329        source = academic_sessions_vocab,
     330        required = False,
     331        readonly = False,
     332        )
     333
    312334ICustomCourseTicket['ca'].order = ICustomCourseTicket['score'].order
    313335
Note: See TracChangeset for help on using the changeset viewer.