students.container - Students Container

Containers for students.

class waeup.kofa.students.container.StudentsContainer[source]

Bases: grokcore.content.components.Container, waeup.kofa.utils.logger.Logger

The node containing the student models

__doc__ = '\n The node containing the student models\n '
__implemented__ = <implementedBy waeup.kofa.students.container.StudentsContainer>
__module__ = 'waeup.kofa.students.container'
__provides__

Special descriptor for class __provides__

The descriptor caches the implementedBy info, so that we can get declarations for objects without instance-specific interfaces a bit quicker.

For example:

>>> from zope.interface import Interface
>>> class IFooFactory(Interface):
...     pass
>>> class IFoo(Interface):
...     pass
>>> class C(object):
...     implements(IFoo)
...     classProvides(IFooFactory)
>>> [i.getName() for i in C.__provides__]
['IFooFactory']
>>> [i.getName() for i in C().__provides__]
['IFoo']
_curr_stud_id = 1000000
addStudent(student)[source]

Add a student with subcontainers.

logger_filename = 'students.log'
logger_name = 'waeup.kofa.${sitename}.students'
unique_student_id

A unique student id.

The student id returned is guaranteed to be unique. It consists of some prefix (normally a single letter) followed by a number with at least 7 digits.

Once a student id was issued, it won’t be issued again.

Obtaining a student id is currently not thread-safe but can be made easily by enabling commented lines.