## ## interfaces.py from zope.interface import Interface, Attribute from zope import schema from waeup.sirp.interfaces import IWAeUPObject from waeup.sirp.students.vocabularies import ( year_range, lgas_vocab, CertificateSource, GenderSource, ) class IStudentNavigation(IWAeUPObject): """Interface needed for student navigation. """ def getStudent(): """Return student object. """ class IStudentBase(IWAeUPObject): """Representation of student base data. """ history = Attribute('Object history, a list of messages.') state = Attribute('Returns the registration state of a student') student_id = Attribute('Randomly generated id') def loggerInfo(ob_class, comment): """Adds an INFO message to the log file """ student_id = schema.TextLine( title = u'Student ID', required = True, ) name = schema.TextLine( title = u'Full Name', default = u'Nobody', required = True, ) password = schema.TextLine( title = u'Password', ) class IStudentClearance(IWAeUPObject): """Representation of student clearance data. """ date_of_birth = schema.Date( title = u'Date of Birth', required = True, ) class IStudentPersonal(IWAeUPObject): """Representation of student personal data. """ perm_address = schema.Text( title = u'Permanent Address', required = False, ) class IStudent(IStudentBase,IStudentClearance,IStudentPersonal): """Representation of a student. """ class IStudentsContainer(IWAeUPObject): """An students container contains university students. """ def addStudent(student): """Add an IStudent object and subcontainers. """ def archive(id=None): """Create on-dist archive of students. If id is `None`, all students are archived. If id contains a single id string, only the respective students are archived. If id contains a list of id strings all of the respective students types are saved to disk. """ def clear(id=None, archive=True): """Remove students of type given by 'id'. Optionally archive the students. If id is `None`, all students are archived. If id contains a single id string, only the respective students are archived. If id contains a list of id strings all of the respective student types are saved to disk. If `archive` is ``False`` none of the archive-handling is done and respective students are simply removed from the database. """ class IStudentStudyCourse(IWAeUPObject): """A container for student study levels. """ certificate = schema.Choice( title = u'Certificate', source = CertificateSource(), default = None, required = True, ) class IStudentAccommodation(IWAeUPObject): """A container for student accommodation objects. """ class IStudentPayments(IWAeUPObject): """A container for student payment objects. """