source: main/waeup.sirp/trunk/src/waeup/sirp/students/interfaces.py @ 6649

Last change on this file since 6649 was 6648, checked in by Henrik Bettermann, 13 years ago

Reorganize vocabularies. The vocabs of the students package are the basis. In the application package only additional sources and vocabs should be defined.

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