[6621] | 1 | ## |
---|
| 2 | ## interfaces.py |
---|
| 3 | from zope.interface import Interface |
---|
| 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 | """ |
---|
[6622] | 10 | student_id = schema.TextLine( |
---|
| 11 | title = u'Student Id', |
---|
| 12 | default = u'None', |
---|
| 13 | required = True, |
---|
| 14 | ) |
---|
| 15 | |
---|
[6621] | 16 | name = schema.TextLine( |
---|
[6631] | 17 | title = u'Full Name', |
---|
[6621] | 18 | default = u'Nobody', |
---|
| 19 | required = True, |
---|
| 20 | ) |
---|
| 21 | |
---|
[6631] | 22 | class IStudentClearance(IWAeUPObject): |
---|
| 23 | """Representation of student clearance data. |
---|
| 24 | """ |
---|
[6622] | 25 | |
---|
[6631] | 26 | date_of_birth = schema.Date( |
---|
| 27 | title = u'Date of Birth', |
---|
| 28 | required = True, |
---|
| 29 | ) |
---|
| 30 | |
---|
| 31 | class IStudentPersonal(IWAeUPObject): |
---|
| 32 | """Representation of student personal data. |
---|
| 33 | """ |
---|
| 34 | |
---|
| 35 | perm_address = schema.Date( |
---|
| 36 | title = u'Permanent Address', |
---|
| 37 | required = False, |
---|
| 38 | ) |
---|
| 39 | |
---|
| 40 | class IStudent(IStudentBase,IStudentClearance,IStudentPersonal): |
---|
| 41 | """Representation of a student. |
---|
| 42 | """ |
---|
| 43 | |
---|
[6621] | 44 | class IStudentsContainer(IWAeUPObject): |
---|
| 45 | """An students container contains university students. |
---|
| 46 | |
---|
| 47 | """ |
---|
| 48 | |
---|
[6633] | 49 | def addStudent(faculty): |
---|
| 50 | """Add an IStudent object and subcontainers. |
---|
| 51 | |
---|
| 52 | """ |
---|
| 53 | |
---|
[6621] | 54 | def archive(id=None): |
---|
| 55 | """Create on-dist archive of students. |
---|
| 56 | |
---|
| 57 | If id is `None`, all students are archived. |
---|
| 58 | |
---|
| 59 | If id contains a single id string, only the respective |
---|
| 60 | students are archived. |
---|
| 61 | |
---|
| 62 | If id contains a list of id strings all of the respective |
---|
| 63 | students types are saved to disk. |
---|
| 64 | """ |
---|
| 65 | |
---|
| 66 | def clear(id=None, archive=True): |
---|
| 67 | """Remove students of type given by 'id'. |
---|
| 68 | |
---|
| 69 | Optionally archive the students. |
---|
| 70 | |
---|
| 71 | If id is `None`, all students are archived. |
---|
| 72 | |
---|
| 73 | If id contains a single id string, only the respective |
---|
| 74 | students are archived. |
---|
| 75 | |
---|
| 76 | If id contains a list of id strings all of the respective |
---|
| 77 | student types are saved to disk. |
---|
| 78 | |
---|
| 79 | If `archive` is ``False`` none of the archive-handling is done |
---|
| 80 | and respective students are simply removed from the |
---|
| 81 | database. |
---|
| 82 | """ |
---|
[6633] | 83 | |
---|
| 84 | class IStudentStudyCourse(IWAeUPObject): |
---|
| 85 | """A container for student study levels. |
---|
| 86 | |
---|
| 87 | """ |
---|
| 88 | |
---|
| 89 | certificate_code = schema.TextLine( |
---|
| 90 | title = u'Certificate Code', |
---|
| 91 | default = u'None', |
---|
| 92 | required = True, |
---|
| 93 | ) |
---|