[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 | |
---|
[6631] | 7 | class IStudentBase(IWAeUPObject): |
---|
| 8 | """Representation of student base data. |
---|
[6621] | 9 | """ |
---|
[6637] | 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 | |
---|
[6622] | 17 | student_id = schema.TextLine( |
---|
| 18 | title = u'Student Id', |
---|
| 19 | default = u'None', |
---|
| 20 | required = True, |
---|
| 21 | ) |
---|
| 22 | |
---|
[6621] | 23 | name = schema.TextLine( |
---|
[6631] | 24 | title = u'Full Name', |
---|
[6621] | 25 | default = u'Nobody', |
---|
| 26 | required = True, |
---|
| 27 | ) |
---|
| 28 | |
---|
[6631] | 29 | class IStudentClearance(IWAeUPObject): |
---|
| 30 | """Representation of student clearance data. |
---|
| 31 | """ |
---|
[6622] | 32 | |
---|
[6631] | 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 | |
---|
[6621] | 51 | class IStudentsContainer(IWAeUPObject): |
---|
| 52 | """An students container contains university students. |
---|
| 53 | |
---|
| 54 | """ |
---|
| 55 | |
---|
[6633] | 56 | def addStudent(faculty): |
---|
| 57 | """Add an IStudent object and subcontainers. |
---|
| 58 | |
---|
| 59 | """ |
---|
| 60 | |
---|
[6621] | 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 | """ |
---|
[6633] | 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 | ) |
---|
[6635] | 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 | |
---|