Changeset 12997


Ignore:
Timestamp:
23 May 2015, 22:37:39 (9 years ago)
Author:
Henrik Bettermann
Message:

More docs.

Location:
main/waeup.kofa/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/docs/source/userdocs/datacenter/intro.rst

    r12906 r12997  
    8484  Although exporters are part of Kofa's batch processing module, we will
    8585  not call them batch processors. Only importers are called batch
    86   processors. Exporters produce CSV files, importer process them.
     86  processors. Exporters produce CSV files, importers process them.
    8787
    8888
  • main/waeup.kofa/trunk/docs/source/userdocs/students.rst

    r12971 r12997  
    3737========
    3838
    39 The `Student` class is a container class which means, there are not only attributes describing the student but also content. Each student container contains exactly three sub-containers: ``studycourse``  (instance of `StudentStudyCourse`), ``payments`` (instance of `StudentPaymentsContainer`)  ``accommodation`` (instance of `StudentAccommodation`). The purposes of them are described further below.
     39The `Student` class is a container class which means, there are not only attributes describing the student entity but also content. Each student container contains exactly three sub-containers: ``studycourse``  (instance of `StudentStudyCourse`), ``payments`` (instance of `StudentPaymentsContainer`)  ``accommodation`` (instance of `StudentAccommodation`). The purposes of them are described further below.
    4040
    4141Let's talk about the attributes and methods belonging to the `Student` class, the so-called 'external behaviour' of student objects specified in Zope 'interfaces'. The data stored with each student object are subdivided into three parts: base data, personal data and clearance data. Each part has its own interface.
     
    4343.. note::
    4444
    45   Interfaces are one of the pillars of Zope's Component Architecture (ZCA, see also :ref:`prerequisites`). They document the 'external behaviour' of objects. In Kofa interfaces are used to specify the attributes, methods and schema fields of objects. The first two are well-known Python concepts. A Zope schema field is a bit more complicated. It's a detailed description of a field to be submitted via forms to the server, or which is processed by a batch processor. In both cases the input data are being validated against the schema. In Kofa, schema fields in interfaces are also used to automtically add `FieldProperty` attributes of the same name to most content classes. This is done by a function called :py:func:`attrs_to_fields<waeup.kofa.utils.helpers.attrs_to_fields>`. These class attributes ensure that corresponding attributes of instances of this class - when being added or changed - always meet the requirements of the schema. Another big advantage of such class attributes is, that attributes with a `FieldProperty` do not need to be set in `__init__` methods.
     45  **Interfaces** are one of the pillars of Zope's Component Architecture (ZCA, see also :ref:`prerequisites`). They document the 'external behaviour' of objects. In Kofa interfaces are used to specify the attributes, methods and schema fields of objects. The first two are well-known Python concepts. A Zope schema field is a bit more complicated. It's a detailed description of a field to be submitted via forms to the server, or which is processed by a batch processor. In both cases the input data are being validated against the schema. In Kofa, schema fields in interfaces are also used to automtically add `FieldProperty` attributes of the same name to most content classes. This is done by a class function called :py:func:`attrs_to_fields<waeup.kofa.utils.helpers.attrs_to_fields>` during startup. These class attributes ensure that corresponding attributes of instances of this class - when being added or changed - always meet the requirements of the schema. Another big advantage of such class attributes is, that attributes with a `FieldProperty` do not need to be set in `__init__` methods.
     46
     47All student classes implement `waeup.kofa.students.interfaces.IStudent` which defines a base set of attributes, schema fields and methods all students must provide. This 'behaviour' is fundamental so that we quote and explain the source code here.
     48
     49.. literalinclude:: ../../../src/waeup/kofa/students/interfaces.py
     50   :pyobject: IStudentBase
     51
     52The first part of the interface lists attributes. Except for the first two (`password` and `temp_password`) they are all read-only property attributes, i.e. attributes with a getter method only. These properties are computed dynamically and can't be set. Most of them return data derived from the ``studycourse`` subobject.
     53
     54The second part of the interface specifies the schema fields, which are instances of schema classes with their `title`, `description`, `default`, `required`, `readonly` and `source` attributes.
    4655
    4756
  • main/waeup.kofa/trunk/src/waeup/kofa/students/interfaces.py

    r12902 r12997  
    7272class IStudentsUtils(Interface):
    7373    """A collection of methods which are subject to customization.
    74 
    7574    """
    7675    def setReturningData(student):
     
    144143class IStudentsContainer(IKofaObject):
    145144    """A students container contains university students.
    146 
    147145    """
    148146    def addStudent(student):
    149147        """Add an IStudent object and subcontainers.
    150 
    151148        """
    152149
     
    185182class IStudentNavigation(IStudentNavigationBase):
    186183    """Interface needed for student navigation, logging, etc.
    187 
    188184    """
    189185    student = Attribute('Student object of context.')
     
    196192class IStudentBase(IKofaObject):
    197193    """Representation of student base data.
    198 
    199     """
    200     history = Attribute('Object history, a list of messages')
    201     state = Attribute('Returns the registration state of a student')
    202     password = Attribute('Encrypted password of a student')
     194    """
     195    password = Attribute('Encrypted password')
    203196    temp_password = Attribute(
    204197        'Dictionary with user name, timestamp and encrypted password')
    205     certcode = Attribute('The certificate code of any chosen study course')
    206     depcode = Attribute('The department code of any chosen study course')
    207     faccode = Attribute('The faculty code of any chosen study course')
    208     entry_session = Attribute('The entry session of the student')
    209     current_session = Attribute('The current session of the student')
    210     current_level = Attribute('The current level of the student')
    211     current_mode = Attribute('The current mode of the student')
    212     current_verdict = Attribute('The current verdict of the student')
     198    history = Attribute('Object history, a list of messages')
     199    state = Attribute('Registration state')
     200    certcode = Attribute('Certificate code of any chosen study course')
     201    depcode = Attribute('Department code of any chosen study course')
     202    faccode = Attribute('Faculty code of any chosen study course')
     203    entry_session = Attribute('Entry session')
     204    current_session = Attribute('Current session')
     205    current_level = Attribute('Current level')
     206    current_mode = Attribute('Current mode')
     207    current_verdict = Attribute('Current verdict')
    213208    fullname = Attribute('All name parts separated by hyphens')
    214     display_fullname = Attribute('The fullname of an applicant')
     209    display_fullname = Attribute('Fullname as displayed on pages')
    215210    is_postgrad = Attribute('True if postgraduate student')
     211    is_special_postgrad = Attribute('True if special postgraduate student')
     212    is_fresh = Attribute('True if fresh student')
     213    before_payment = Attribute('True if no previous payment has to be made')
     214    personal_data_expired = Attribute('True if personal data expired')
     215    transcript_enabled = Attribute('True if transcript processing is enabled')
    216216
    217217    suspended = schema.Bool(
     
    286286        )
    287287
     288    def writeLogMessage(view, message):
     289        """Write formatted log message into student.log.
     290        """
     291
    288292    def setTempPassword(user, password):
    289293        """Set a temporary password (LDAP-compatible) SSHA encoded for
    290294        officers.
    291 
    292295        """
    293296
    294297    def getTempPassword():
    295298        """Check if a temporary password has been set and if it
    296         is not expired.
    297 
    298         Return the temporary password if valid,
     299        is not expired. Return the temporary password if valid,
    299300        None otherwise. Unset the temporary password if expired.
    300301        """
     
    303304        current_level, current_verdict):
    304305        """ Creates a new studycourse and backups the old one.
    305 
     306        """
     307
     308    def revert_transfer():
     309        """ Revert previous transfer.
    306310        """
    307311
    308312class IUGStudentClearance(IKofaObject):
    309313    """Representation of undergraduate student clearance data.
    310 
    311314    """
    312315    officer_comment = schema.Text(
     
    383386class IStudentPersonalEdit(IStudentPersonal):
    384387    """Interface for editing personal data by students.
    385 
    386388    Here we can repeat the fields from IStudentPersonal and set the
    387389    `required` if necessary.
     
    395397class IStudentUpdateByRegNo(IStudent):
    396398    """Representation of a student. Skip regular reg_number validation.
    397 
    398399    """
    399400    reg_number = schema.TextLine(
  • main/waeup.kofa/trunk/src/waeup/kofa/utils/batching.py

    r12981 r12997  
    297297        1. An empty row is skipped.
    298298
    299         2. Empty strings in the row are replaced by ignore-markers.
     299        2. Empty strings or lists (``[]``) in the row are replaced by
     300           ignore markers.
    300301
    301302        3. The `BatchProcessor.checkConversion` method validates and converts
Note: See TracChangeset for help on using the changeset viewer.