Ignore:
Timestamp:
20 Nov 2011, 07:35:35 (13 years ago)
Author:
Henrik Bettermann
Message:

Turn all functions subject to customization into methods of a global utility component called StudentsUtils?. This is really an incredible improvement and eases customization a lot.

File:
1 edited

Legend:

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

    r7144 r7150  
    33import re
    44from datetime import datetime
    5 from zope.interface import Attribute, invariant
     5from zope.interface import Attribute, invariant, Interface
    66from zope.interface.exceptions import Invalid
    77from zope import schema
     
    2626    return True
    2727
     28class IStudentsUtils(Interface):
     29    """A collection of methods which are subject to customization.
     30
     31    """
     32    def get_payment_details(category, student):
     33        """Get the payment dates of a student for the payment category
     34        specified.
     35
     36        """
     37
     38    def get_accommodation_details(student):
     39        """Determine the accommodation dates of a student.
     40
     41        """
     42
     43    def select_bed(available_beds):
     44        """Select a bed from a list of available beds.
     45
     46        In the standard configuration we select the first bed found,
     47        but can also randomize the selection if we like.
     48        """
     49
     50    def render_pdf(view, subject='', filename='slip.pdf',):
     51        """Render pdf slips for various pages.
     52
     53        """
     54
    2855class IStudentsContainer(IWAeUPObject):
    2956    """A students container contains university students.
    3057
    3158    """
    32 
    3359    def addStudent(student):
    3460        """Add an IStudent object and subcontainers.
     
    6894class IStudentNavigation(IWAeUPObject):
    6995    """Interface needed for student navigation.
    70     """
    71 
     96
     97    """
    7298    def getStudent():
    7399        """Return student object.
     100
    74101        """
    75102
    76103class IStudentBase(IWAeUPObject):
    77104    """Representation of student base data.
     105
    78106    """
    79107    history = Attribute('Object history, a list of messages')
     
    84112
    85113    def loggerInfo(ob_class, comment):
    86         """Adds an INFO message to the log file
     114        """Adds an INFO message to the log file.
     115
    87116        """
    88117
     
    141170class IStudentClearance(IWAeUPObject):
    142171    """Representation of student clearance data.
    143     """
    144 
     172
     173    """
    145174    date_of_birth = schema.Date(
    146175        title = u'Date of Birth',
     
    162191class IStudentPersonal(IWAeUPObject):
    163192    """Representation of student personal data.
    164     """
    165 
     193
     194    """
    166195    perm_address = schema.Text(
    167196        title = u'Permanent Address',
     
    171200class IStudent(IStudentBase,IStudentClearance,IStudentPersonal):
    172201    """Representation of a student.
     202
    173203    """
    174204
    175205class IStudentUpdateByRegNo(IStudent):
    176206    """Representation of a student. Skip regular reg_number validation.
    177     """
    178 
     207
     208    """
    179209    reg_number = schema.TextLine(
    180210        title = u'Registration Number',
     
    185215class IStudentUpdateByMatricNo(IStudent):
    186216    """Representation of a student. Skip regular matric_number validation.
    187     """
    188 
     217
     218    """
    189219    matric_number = schema.TextLine(
    190220        title = u'Matriculation Number',
     
    197227
    198228    """
    199 
    200229    certificate = schema.Choice(
    201230        title = u'Certificate',
     
    256285
    257286    """
    258 
    259287    current_level = schema.Int(
    260288        title = u'Current Level',
     
    318346
    319347class ICourseTicketAdd(ICourseTicket):
    320     """An interface for adding course tickets
     348    """An interface for adding course tickets.
    321349
    322350    """
     
    336364
    337365    """
    338 
    339366    bed = Attribute('The bed object.')
    340367
     
    375402
    376403    def getSessionString():
    377         """Returns the the title of academic_sessions_vocab term
     404        """Returns the the title of academic_sessions_vocab term.
     405
    378406        """
    379407
     
    387415
    388416    """
    389 
    390417    p_session = schema.Choice(
    391418        title = u'Payment Session',
     
    401428class IStudentClearanceEdit(IStudentClearance):
    402429    """Interface needed for restricted editing of student clearance data.
     430
    403431    """
    404432
    405433class IStudentPersonalEdit(IStudentPersonal):
    406434    """Interface needed for restricted editing of student personal data.
    407     """
     435
     436    """
Note: See TracChangeset for help on using the changeset viewer.