[6621] | 1 | ## |
---|
| 2 | ## interfaces.py |
---|
[6637] | 3 | from zope.interface import Interface, Attribute |
---|
[6621] | 4 | from zope import schema |
---|
| 5 | from waeup.sirp.interfaces import IWAeUPObject |
---|
| 6 | |
---|
[6642] | 7 | class IStudentNavigation(IWAeUPObject): |
---|
| 8 | """Interface needed for student navigation. |
---|
| 9 | """ |
---|
| 10 | |
---|
| 11 | def getStudent(): |
---|
| 12 | """Return student object. |
---|
| 13 | """ |
---|
| 14 | |
---|
[6631] | 15 | class IStudentBase(IWAeUPObject): |
---|
| 16 | """Representation of student base data. |
---|
[6621] | 17 | """ |
---|
[6637] | 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 | |
---|
[6622] | 25 | student_id = schema.TextLine( |
---|
| 26 | title = u'Student Id', |
---|
| 27 | default = u'None', |
---|
| 28 | required = True, |
---|
| 29 | ) |
---|
| 30 | |
---|
[6621] | 31 | name = schema.TextLine( |
---|
[6631] | 32 | title = u'Full Name', |
---|
[6621] | 33 | default = u'Nobody', |
---|
| 34 | required = True, |
---|
| 35 | ) |
---|
| 36 | |
---|
[6631] | 37 | class IStudentClearance(IWAeUPObject): |
---|
| 38 | """Representation of student clearance data. |
---|
| 39 | """ |
---|
[6622] | 40 | |
---|
[6631] | 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 | |
---|
[6621] | 59 | class IStudentsContainer(IWAeUPObject): |
---|
| 60 | """An students container contains university students. |
---|
| 61 | |
---|
| 62 | """ |
---|
| 63 | |
---|
[6642] | 64 | def addStudent(student): |
---|
[6633] | 65 | """Add an IStudent object and subcontainers. |
---|
| 66 | |
---|
| 67 | """ |
---|
| 68 | |
---|
[6621] | 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 | """ |
---|
[6633] | 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 | ) |
---|
[6635] | 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 | |
---|