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

Last change on this file since 6634 was 6633, checked in by Henrik Bettermann, 14 years ago

We don't need a factory for StudentsContainer?.

Add addStudent method which automatically creates subcontainers.

Add StudentStudyCourse? container class which holds the study course data and contains student study level objects for course registration.

  • Property svn:keywords set to Id
File size: 2.3 KB
Line 
1##
2## interfaces.py
3from zope.interface import Interface
4from zope import schema
5from waeup.sirp.interfaces import IWAeUPObject
6
7class IStudentBase(IWAeUPObject):
8    """Representation of student base data.
9    """
10    student_id = schema.TextLine(
11        title = u'Student Id',
12        default = u'None',
13        required = True,
14        )
15
16    name = schema.TextLine(
17        title = u'Full Name',
18        default = u'Nobody',
19        required = True,
20        )
21
22class IStudentClearance(IWAeUPObject):
23    """Representation of student clearance data.
24    """
25
26    date_of_birth = schema.Date(
27        title = u'Date of Birth',
28        required = True,
29        )
30
31class 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
40class IStudent(IStudentBase,IStudentClearance,IStudentPersonal):
41    """Representation of a student.
42    """
43
44class IStudentsContainer(IWAeUPObject):
45    """An students container contains university students.
46
47    """
48
49    def addStudent(faculty):
50        """Add an IStudent object and subcontainers.
51
52        """
53
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        """
83
84class 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        )
Note: See TracBrowser for help on using the repository browser.