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

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

Add clearance_locked attribute and set True when a student is added.

Add clearance edit page for students.

Shorten page template names.

Rename Edit buttons for officers. Officers are managing and students are editing objects.

  • Property svn:keywords set to Id
File size: 3.8 KB
RevLine 
[6621]1##
2## interfaces.py
[6637]3from zope.interface import Interface, Attribute
[6621]4from zope import schema
5from waeup.sirp.interfaces import IWAeUPObject
[6648]6from waeup.sirp.students.vocabularies import (
7  year_range, lgas_vocab, CertificateSource, GenderSource,
8  )
[6621]9
[6692]10class IStudentsContainer(IWAeUPObject):
11    """An students container contains university students.
12
13    """
14
15    def addStudent(student):
16        """Add an IStudent object and subcontainers.
17
18        """
19
20    def archive(id=None):
21        """Create on-dist archive of students.
22
23        If id is `None`, all students are archived.
24
25        If id contains a single id string, only the respective
26        students are archived.
27
28        If id contains a list of id strings all of the respective
29        students types are saved to disk.
30        """
31
32    def clear(id=None, archive=True):
33        """Remove students of type given by 'id'.
34
35        Optionally archive the students.
36
37        If id is `None`, all students are archived.
38
39        If id contains a single id string, only the respective
40        students are archived.
41
42        If id contains a list of id strings all of the respective
43        student types are saved to disk.
44
45        If `archive` is ``False`` none of the archive-handling is done
46        and respective students are simply removed from the
47        database.
48        """
49
[6642]50class IStudentNavigation(IWAeUPObject):
51    """Interface needed for student navigation.
52    """
53
54    def getStudent():
55        """Return student object.
56        """
57
[6631]58class IStudentBase(IWAeUPObject):
59    """Representation of student base data.
[6621]60    """
[6637]61    history = Attribute('Object history, a list of messages.')
62    state = Attribute('Returns the registration state of a student')
[6694]63    #student_id = Attribute('Randomly generated id')
[6637]64
65    def loggerInfo(ob_class, comment):
66        """Adds an INFO message to the log file
67        """
68
[6665]69    student_id = schema.TextLine(
70        title = u'Student ID',
71        required = True,
72        )
73
[6621]74    name = schema.TextLine(
[6631]75        title = u'Full Name',
[6621]76        default = u'Nobody',
77        required = True,
78        )
79
[6694]80    password = schema.Password(
[6665]81        title = u'Password',
82        )
83
[6631]84class IStudentClearance(IWAeUPObject):
85    """Representation of student clearance data.
86    """
[6622]87
[6631]88    date_of_birth = schema.Date(
89        title = u'Date of Birth',
90        required = True,
91        )
92
[6695]93    clearance_locked = schema.Bool(
94        title = u'Clearance form locked',
95        default = False,
96        )
97
[6631]98class IStudentPersonal(IWAeUPObject):
99    """Representation of student personal data.
100    """
101
[6651]102    perm_address = schema.Text(
[6631]103        title = u'Permanent Address',
104        required = False,
105        )
106
107class IStudent(IStudentBase,IStudentClearance,IStudentPersonal):
108    """Representation of a student.
109    """
110
[6633]111class IStudentStudyCourse(IWAeUPObject):
112    """A container for student study levels.
113
114    """
115
[6648]116    certificate = schema.Choice(
117        title = u'Certificate',
118        source = CertificateSource(),
119        default = None,
[6633]120        required = True,
121        )
[6635]122
123class IStudentAccommodation(IWAeUPObject):
124    """A container for student accommodation objects.
125
126    """
127
128class IStudentPayments(IWAeUPObject):
129    """A container for student payment objects.
130
131    """
132
[6694]133# Interfaces for students only
134
135class IStudentBaseEdit(IStudentBase):
136    """Interface needed for editing of student base data by students.
137    """
138
139    name = schema.TextLine(
140        title = u'Full Name',
141        default = u'Nobody',
142        required = True,
143        readonly = True,
144        )
145
146IStudentBaseEdit['name'].order =  IStudentBase['name'].order
147
148class IStudentClearanceEdit(IStudentClearance):
149    """Interface needed for restricted editing of student clearance data.
150    """
151
152class IStudentPersonalEdit(IStudentPersonal):
153    """Interface needed for restricted editing of student personal data.
154    """
Note: See TracBrowser for help on using the repository browser.