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

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

Add attribute to store admission checking access code in student object.

Be more verbose when setting password with access code.

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