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

Last change on this file since 6696 was 6696, checked in by Henrik Bettermann, 14 years ago

Add reg_number attribute which is needed for first-time login (admission checking).

  • Property svn:keywords set to Id
File size: 4.1 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.students.vocabularies import (
7  year_range, lgas_vocab, CertificateSource, GenderSource,
8  )
9
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
50class IStudentNavigation(IWAeUPObject):
51    """Interface needed for student navigation.
52    """
53
54    def getStudent():
55        """Return student object.
56        """
57
58class IStudentBase(IWAeUPObject):
59    """Representation of student base data.
60    """
61    history = Attribute('Object history, a list of messages.')
62    state = Attribute('Returns the registration state of a student')
63    #student_id = Attribute('Randomly generated id')
64
65    def loggerInfo(ob_class, comment):
66        """Adds an INFO message to the log file
67        """
68
69    student_id = schema.TextLine(
70        title = u'Student ID',
71        required = True,
72        )
73
74    name = schema.TextLine(
75        title = u'Full Name',
76        default = u'Nobody',
77        required = True,
78        )
79
80    password = schema.Password(
81        title = u'Password',
82        required = False,
83        )
84
85    reg_number = schema.TextLine(
86        title = u'Registration Number',
87        default = u'',
88        required = True,
89        readonly = False,
90        )
91
92class IStudentClearance(IWAeUPObject):
93    """Representation of student clearance data.
94    """
95
96    date_of_birth = schema.Date(
97        title = u'Date of Birth',
98        required = True,
99        )
100
101    clearance_locked = schema.Bool(
102        title = u'Clearance form locked',
103        default = False,
104        )
105
106class IStudentPersonal(IWAeUPObject):
107    """Representation of student personal data.
108    """
109
110    perm_address = schema.Text(
111        title = u'Permanent Address',
112        required = False,
113        )
114
115class IStudent(IStudentBase,IStudentClearance,IStudentPersonal):
116    """Representation of a student.
117    """
118
119class IStudentStudyCourse(IWAeUPObject):
120    """A container for student study levels.
121
122    """
123
124    certificate = schema.Choice(
125        title = u'Certificate',
126        source = CertificateSource(),
127        default = None,
128        required = True,
129        )
130
131class IStudentAccommodation(IWAeUPObject):
132    """A container for student accommodation objects.
133
134    """
135
136class IStudentPayments(IWAeUPObject):
137    """A container for student payment objects.
138
139    """
140
141# Interfaces for students only
142
143class IStudentBaseEdit(IStudentBase):
144    """Interface needed for editing of student base data by students.
145    """
146
147    name = schema.TextLine(
148        title = u'Full Name',
149        default = u'Nobody',
150        required = True,
151        readonly = True,
152        )
153
154    password = schema.Password(
155        title = u'Password',
156        required = True,
157        )
158
159IStudentBaseEdit['name'].order =  IStudentBase['name'].order
160
161class IStudentClearanceEdit(IStudentClearance):
162    """Interface needed for restricted editing of student clearance data.
163    """
164
165class IStudentPersonalEdit(IStudentPersonal):
166    """Interface needed for restricted editing of student personal data.
167    """
Note: See TracBrowser for help on using the repository browser.