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