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