Changeset 12997
- Timestamp:
- 23 May 2015, 22:37:39 (10 years ago)
- Location:
- main/waeup.kofa/trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/docs/source/userdocs/datacenter/intro.rst
r12906 r12997 84 84 Although exporters are part of Kofa's batch processing module, we will 85 85 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. 87 87 88 88 -
main/waeup.kofa/trunk/docs/source/userdocs/students.rst
r12971 r12997 37 37 ======== 38 38 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.39 The `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. 40 40 41 41 Let'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. … … 43 43 .. note:: 44 44 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 47 All 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 52 The 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 54 The 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. 46 55 47 56 -
main/waeup.kofa/trunk/src/waeup/kofa/students/interfaces.py
r12902 r12997 72 72 class IStudentsUtils(Interface): 73 73 """A collection of methods which are subject to customization. 74 75 74 """ 76 75 def setReturningData(student): … … 144 143 class IStudentsContainer(IKofaObject): 145 144 """A students container contains university students. 146 147 145 """ 148 146 def addStudent(student): 149 147 """Add an IStudent object and subcontainers. 150 151 148 """ 152 149 … … 185 182 class IStudentNavigation(IStudentNavigationBase): 186 183 """Interface needed for student navigation, logging, etc. 187 188 184 """ 189 185 student = Attribute('Student object of context.') … … 196 192 class IStudentBase(IKofaObject): 197 193 """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') 203 196 temp_password = Attribute( 204 197 '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') 213 208 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') 215 210 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') 216 216 217 217 suspended = schema.Bool( … … 286 286 ) 287 287 288 def writeLogMessage(view, message): 289 """Write formatted log message into student.log. 290 """ 291 288 292 def setTempPassword(user, password): 289 293 """Set a temporary password (LDAP-compatible) SSHA encoded for 290 294 officers. 291 292 295 """ 293 296 294 297 def getTempPassword(): 295 298 """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, 299 300 None otherwise. Unset the temporary password if expired. 300 301 """ … … 303 304 current_level, current_verdict): 304 305 """ Creates a new studycourse and backups the old one. 305 306 """ 307 308 def revert_transfer(): 309 """ Revert previous transfer. 306 310 """ 307 311 308 312 class IUGStudentClearance(IKofaObject): 309 313 """Representation of undergraduate student clearance data. 310 311 314 """ 312 315 officer_comment = schema.Text( … … 383 386 class IStudentPersonalEdit(IStudentPersonal): 384 387 """Interface for editing personal data by students. 385 386 388 Here we can repeat the fields from IStudentPersonal and set the 387 389 `required` if necessary. … … 395 397 class IStudentUpdateByRegNo(IStudent): 396 398 """Representation of a student. Skip regular reg_number validation. 397 398 399 """ 399 400 reg_number = schema.TextLine( -
main/waeup.kofa/trunk/src/waeup/kofa/utils/batching.py
r12981 r12997 297 297 1. An empty row is skipped. 298 298 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. 300 301 301 302 3. The `BatchProcessor.checkConversion` method validates and converts
Note: See TracChangeset for help on using the changeset viewer.