Ignore:
Timestamp:
25 Oct 2012, 21:52:10 (12 years ago)
Author:
Henrik Bettermann
Message:

Reorganize ICourseTicket. Add ICourseTicketImport which validates a new field called level_session.

Customize checkConversion of CourseTicketProcessor?:
If level_session is provided in row the importer checks if
the parent studylevel exists and if its level_session
attribute corresponds with the expected value in row. The error message
then tells us why course result import fails.

File:
1 edited

Legend:

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

    r9334 r9420  
    2828from waeup.kofa.students.vocabularies import (
    2929    StudyLevelSource, contextual_reg_num_source, contextual_mat_num_source,
    30     GenderSource, nats_vocab,
     30    GenderSource, nats_vocab
    3131    )
    3232from waeup.kofa.payments.interfaces import (
    3333    IPaymentsContainer, IOnlinePayment)
    3434from waeup.kofa.university.vocabularies import (
    35     CourseSource, StudyModeSource, CertificateSource)
     35    CourseSource, StudyModeSource, CertificateSource, SemesterSource)
    3636
    3737# VerdictSource can't be placed into the vocabularies module because it
     
    488488
    489489class ICourseTicket(IKofaObject):
    490     """A course ticket.
     490    """An interface for course tickets.
    491491
    492492    """
    493493    code = Attribute('code of the original course')
    494     title = Attribute('title of the original course')
    495     credits = Attribute('credits of the original course')
    496     passmark = Attribute('passmark of the original course')
    497     semester = Attribute('semester of the original course')
    498     fcode = Attribute('faculty code of the original course')
    499     dcode = Attribute('department code of the original course')
    500494    certcode = Attribute('certificate code of the study course')
     495
     496    title = schema.TextLine(
     497        title = _(u'Title'),
     498        required = False,
     499        )
     500
     501    fcode = schema.TextLine(
     502        title = _(u'Faculty Code'),
     503        required = False,
     504        )
     505
     506    dcode = schema.TextLine(
     507        title = _(u'Department Code'),
     508        required = False,
     509        )
     510
     511    semester = schema.Choice(
     512        title = _(u'Semester/Term'),
     513        source = SemesterSource(),
     514        required = False,
     515        )
     516
     517    passmark = schema.Int(
     518        title = _(u'Passmark'),
     519        required = False,
     520        )
     521
     522    credits = schema.Int(
     523        title = _(u'Credits'),
     524        required = False,
     525        )
    501526
    502527    mandatory = schema.Bool(
     
    504529        default = False,
    505530        required = False,
    506         readonly = False,
    507531        )
    508532
     
    511535        default = 0,
    512536        required = False,
    513         readonly = False,
     537        )
     538
     539    carry_over = schema.Bool(
     540        title = _(u'Carry-over Course'),
     541        default = False,
     542        required = False,
    514543        )
    515544
     
    518547        default = False,
    519548        required = False,
    520         readonly = True,
    521         )
    522 
    523     carry_over = schema.Bool(
    524         title = _(u'Carry-over Course'),
    525         default = False,
    526         required = False,
    527         readonly = False,
    528         )
    529 
    530     credits = schema.Int(
    531         title = _(u'Credits'),
    532         required = False,
    533         )
    534 
    535     passmark = schema.Int(
    536         title = _(u'Passmark'),
    537         required = False,
    538         )
     549        )
     550
    539551
    540552    def getLevel():
     
    546558        """
    547559
    548 class ICourseTicketAdd(ICourseTicket):
     560class ICourseTicketAdd(IKofaObject):
    549561    """An interface for adding course tickets.
    550562
     
    556568        )
    557569
     570class ICourseTicketImport(ICourseTicket):
     571    """An interface for importing course results and nothing more.
     572
     573    """
     574    score = schema.Int(
     575        title = _(u'Score'),
     576        required = False,
     577        readonly = False,
     578        )
     579
     580    level_session = schema.Choice(
     581        title = _(u'Level Session'),
     582        source = academic_sessions_vocab,
     583        required = False,
     584        readonly = False,
     585        )
     586
    558587class IStudentAccommodation(IKofaObject):
    559588    """A container for student accommodation objects.
Note: See TracChangeset for help on using the changeset viewer.