1 | ## |
---|
2 | ## interfaces.py |
---|
3 | from zope.interface import Interface, Attribute |
---|
4 | from zope import schema |
---|
5 | from waeup.sirp.interfaces import IWAeUPObject |
---|
6 | |
---|
7 | class IStudentBase(IWAeUPObject): |
---|
8 | """Representation of student base data. |
---|
9 | """ |
---|
10 | history = Attribute('Object history, a list of messages.') |
---|
11 | state = Attribute('Returns the registration state of a student') |
---|
12 | |
---|
13 | def loggerInfo(ob_class, comment): |
---|
14 | """Adds an INFO message to the log file |
---|
15 | """ |
---|
16 | |
---|
17 | student_id = schema.TextLine( |
---|
18 | title = u'Student Id', |
---|
19 | default = u'None', |
---|
20 | required = True, |
---|
21 | ) |
---|
22 | |
---|
23 | name = schema.TextLine( |
---|
24 | title = u'Full Name', |
---|
25 | default = u'Nobody', |
---|
26 | required = True, |
---|
27 | ) |
---|
28 | |
---|
29 | class IStudentClearance(IWAeUPObject): |
---|
30 | """Representation of student clearance data. |
---|
31 | """ |
---|
32 | |
---|
33 | date_of_birth = schema.Date( |
---|
34 | title = u'Date of Birth', |
---|
35 | required = True, |
---|
36 | ) |
---|
37 | |
---|
38 | class IStudentPersonal(IWAeUPObject): |
---|
39 | """Representation of student personal data. |
---|
40 | """ |
---|
41 | |
---|
42 | perm_address = schema.Date( |
---|
43 | title = u'Permanent Address', |
---|
44 | required = False, |
---|
45 | ) |
---|
46 | |
---|
47 | class IStudent(IStudentBase,IStudentClearance,IStudentPersonal): |
---|
48 | """Representation of a student. |
---|
49 | """ |
---|
50 | |
---|
51 | class IStudentsContainer(IWAeUPObject): |
---|
52 | """An students container contains university students. |
---|
53 | |
---|
54 | """ |
---|
55 | |
---|
56 | def addStudent(faculty): |
---|
57 | """Add an IStudent object and subcontainers. |
---|
58 | |
---|
59 | """ |
---|
60 | |
---|
61 | def archive(id=None): |
---|
62 | """Create on-dist archive of students. |
---|
63 | |
---|
64 | If id is `None`, all students are archived. |
---|
65 | |
---|
66 | If id contains a single id string, only the respective |
---|
67 | students are archived. |
---|
68 | |
---|
69 | If id contains a list of id strings all of the respective |
---|
70 | students types are saved to disk. |
---|
71 | """ |
---|
72 | |
---|
73 | def clear(id=None, archive=True): |
---|
74 | """Remove students of type given by 'id'. |
---|
75 | |
---|
76 | Optionally archive the students. |
---|
77 | |
---|
78 | If id is `None`, all students are archived. |
---|
79 | |
---|
80 | If id contains a single id string, only the respective |
---|
81 | students are archived. |
---|
82 | |
---|
83 | If id contains a list of id strings all of the respective |
---|
84 | student types are saved to disk. |
---|
85 | |
---|
86 | If `archive` is ``False`` none of the archive-handling is done |
---|
87 | and respective students are simply removed from the |
---|
88 | database. |
---|
89 | """ |
---|
90 | |
---|
91 | class IStudentStudyCourse(IWAeUPObject): |
---|
92 | """A container for student study levels. |
---|
93 | |
---|
94 | """ |
---|
95 | |
---|
96 | certificate_code = schema.TextLine( |
---|
97 | title = u'Certificate Code', |
---|
98 | default = u'None', |
---|
99 | required = True, |
---|
100 | ) |
---|
101 | |
---|
102 | class IStudentAccommodation(IWAeUPObject): |
---|
103 | """A container for student accommodation objects. |
---|
104 | |
---|
105 | """ |
---|
106 | |
---|
107 | class IStudentPayments(IWAeUPObject): |
---|
108 | """A container for student payment objects. |
---|
109 | |
---|
110 | """ |
---|
111 | |
---|