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

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

Add matriculation number to student's base data.

Registration and matriculation numbers must be unique. Use UniqueField? indexes in catalog for both.

Test fails, I don't know why.

  • Property svn:keywords set to Id
File size: 4.9 KB
Line 
1##
2## interfaces.py
3from zope.interface import Interface, Attribute
4from zope import schema
5from waeup.sirp.interfaces import IWAeUPObject
6from waeup.sirp.university.vocabularies import study_modes
7from waeup.sirp.students.vocabularies import (
8  year_range, lgas_vocab, CertificateSource, GenderSource,
9  academic_sessions_vocab, verdicts, StudyLevelSource,
10  )
11
12class IStudentsContainer(IWAeUPObject):
13    """An students container contains university students.
14
15    """
16
17    def addStudent(student):
18        """Add an IStudent object and subcontainers.
19
20        """
21
22    def archive(id=None):
23        """Create on-dist archive of students.
24
25        If id is `None`, all students are archived.
26
27        If id contains a single id string, only the respective
28        students are archived.
29
30        If id contains a list of id strings all of the respective
31        students types are saved to disk.
32        """
33
34    def clear(id=None, archive=True):
35        """Remove students of type given by 'id'.
36
37        Optionally archive the students.
38
39        If id is `None`, all students are archived.
40
41        If id contains a single id string, only the respective
42        students are archived.
43
44        If id contains a list of id strings all of the respective
45        student types are saved to disk.
46
47        If `archive` is ``False`` none of the archive-handling is done
48        and respective students are simply removed from the
49        database.
50        """
51
52class IStudentNavigation(IWAeUPObject):
53    """Interface needed for student navigation.
54    """
55
56    def getStudent():
57        """Return student object.
58        """
59
60class IStudentBase(IWAeUPObject):
61    """Representation of student base data.
62    """
63    history = Attribute('Object history, a list of messages.')
64    state = Attribute('Returns the registration state of a student')
65    #student_id = Attribute('Randomly generated id')
66    password = Attribute('Encrypted password of a student')
67    adm_code = Attribute('Admission checking access code')
68
69    def loggerInfo(ob_class, comment):
70        """Adds an INFO message to the log file
71        """
72
73    student_id = schema.TextLine(
74        title = u'Student ID',
75        required = True,
76        )
77
78    name = schema.TextLine(
79        title = u'Full Name',
80        default = u'Nobody',
81        required = True,
82        )
83
84    reg_number = schema.TextLine(
85        title = u'Registration Number',
86        default = u'',
87        required = True,
88        readonly = False,
89        )
90
91    matric_number = schema.TextLine(
92        title = u'Matriculation Number',
93        default = u'',
94        required = False,
95        readonly = False,
96        )
97
98class IStudentClearance(IWAeUPObject):
99    """Representation of student clearance data.
100    """
101
102    date_of_birth = schema.Date(
103        title = u'Date of Birth',
104        required = True,
105        )
106
107    clearance_locked = schema.Bool(
108        title = u'Clearance form locked',
109        default = False,
110        )
111
112class IStudentPersonal(IWAeUPObject):
113    """Representation of student personal data.
114    """
115
116    perm_address = schema.Text(
117        title = u'Permanent Address',
118        required = False,
119        )
120
121class IStudent(IStudentBase,IStudentClearance,IStudentPersonal):
122    """Representation of a student.
123    """
124
125class IStudentStudyCourse(IWAeUPObject):
126    """A container for student study levels.
127
128    """
129
130    certificate = schema.Choice(
131        title = u'Certificate',
132        source = CertificateSource(),
133        default = None,
134        required = True,
135        )
136
137    current_session = schema.Choice(
138        title = u'Current Session',
139        source = academic_sessions_vocab,
140        default = None,
141        required = True,
142        )
143
144    current_level = schema.Choice(
145        title = u'Current Level',
146        source = StudyLevelSource(),
147        default = None,
148        required = False,
149        )
150
151    current_verdict = schema.Choice(
152        title = u'Current Verdict',
153        source = verdicts,
154        default = None,
155        required = False,
156        )
157
158    previous_verdict = schema.Choice(
159        title = u'Previous Verdict',
160        source = verdicts,
161        default = None,
162        required = False,
163        )
164
165class IStudentAccommodation(IWAeUPObject):
166    """A container for student accommodation objects.
167
168    """
169
170class IStudentPayments(IWAeUPObject):
171    """A container for student payment objects.
172
173    """
174
175# Interfaces for students only
176
177class IStudentBaseEdit(IStudentBase):
178    """Interface needed for editing of student base data by students.
179    """
180
181    name = schema.TextLine(
182        title = u'Full Name',
183        default = u'Nobody',
184        required = True,
185        readonly = True,
186        )
187
188IStudentBaseEdit['name'].order =  IStudentBase['name'].order
189
190class IStudentClearanceEdit(IStudentClearance):
191    """Interface needed for restricted editing of student clearance data.
192    """
193
194class IStudentPersonalEdit(IStudentPersonal):
195    """Interface needed for restricted editing of student personal data.
196    """
Note: See TracBrowser for help on using the repository browser.