source: main/waeup.sirp/trunk/src/waeup/sirp/students/interfaces.py @ 6692

Last change on this file since 6692 was 6692, checked in by Henrik Bettermann, 13 years ago

Move IStudentsContainer to the top.

  • Property svn:keywords set to Id
File size: 3.1 KB
RevLine 
[6621]1##
2## interfaces.py
[6637]3from zope.interface import Interface, Attribute
[6621]4from zope import schema
5from waeup.sirp.interfaces import IWAeUPObject
[6648]6from waeup.sirp.students.vocabularies import (
7  year_range, lgas_vocab, CertificateSource, GenderSource,
8  )
[6621]9
[6692]10class IStudentsContainer(IWAeUPObject):
11    """An students container contains university students.
12
13    """
14
15    def addStudent(student):
16        """Add an IStudent object and subcontainers.
17
18        """
19
20    def archive(id=None):
21        """Create on-dist archive of students.
22
23        If id is `None`, all students are archived.
24
25        If id contains a single id string, only the respective
26        students are archived.
27
28        If id contains a list of id strings all of the respective
29        students types are saved to disk.
30        """
31
32    def clear(id=None, archive=True):
33        """Remove students of type given by 'id'.
34
35        Optionally archive the students.
36
37        If id is `None`, all students are archived.
38
39        If id contains a single id string, only the respective
40        students are archived.
41
42        If id contains a list of id strings all of the respective
43        student types are saved to disk.
44
45        If `archive` is ``False`` none of the archive-handling is done
46        and respective students are simply removed from the
47        database.
48        """
49
[6642]50class IStudentNavigation(IWAeUPObject):
51    """Interface needed for student navigation.
52    """
53
54    def getStudent():
55        """Return student object.
56        """
57
[6631]58class IStudentBase(IWAeUPObject):
59    """Representation of student base data.
[6621]60    """
[6637]61    history = Attribute('Object history, a list of messages.')
62    state = Attribute('Returns the registration state of a student')
[6651]63    student_id = Attribute('Randomly generated id')
[6637]64
65    def loggerInfo(ob_class, comment):
66        """Adds an INFO message to the log file
67        """
68
[6665]69    student_id = schema.TextLine(
70        title = u'Student ID',
71        required = True,
72        )
73
[6621]74    name = schema.TextLine(
[6631]75        title = u'Full Name',
[6621]76        default = u'Nobody',
77        required = True,
78        )
79
[6665]80    password = schema.TextLine(
81        title = u'Password',
82        )
83
[6631]84class IStudentClearance(IWAeUPObject):
85    """Representation of student clearance data.
86    """
[6622]87
[6631]88    date_of_birth = schema.Date(
89        title = u'Date of Birth',
90        required = True,
91        )
92
93class IStudentPersonal(IWAeUPObject):
94    """Representation of student personal data.
95    """
96
[6651]97    perm_address = schema.Text(
[6631]98        title = u'Permanent Address',
99        required = False,
100        )
101
102class IStudent(IStudentBase,IStudentClearance,IStudentPersonal):
103    """Representation of a student.
104    """
105
[6633]106class IStudentStudyCourse(IWAeUPObject):
107    """A container for student study levels.
108
109    """
110
[6648]111    certificate = schema.Choice(
112        title = u'Certificate',
113        source = CertificateSource(),
114        default = None,
[6633]115        required = True,
116        )
[6635]117
118class IStudentAccommodation(IWAeUPObject):
119    """A container for student accommodation objects.
120
121    """
122
123class IStudentPayments(IWAeUPObject):
124    """A container for student payment objects.
125
126    """
127
Note: See TracBrowser for help on using the repository browser.