source: main/kofacustom.edocons/trunk/src/kofacustom/edocons/students/interfaces.py @ 17601

Last change on this file since 17601 was 17408, checked in by Henrik Bettermann, 19 months ago

Add missing and default

  • Property svn:keywords set to Id
File size: 5.1 KB
Line 
1## $Id: interfaces.py 17408 2023-05-10 07:37:16Z henrik $
2##
3## Copyright (C) 2012 Uli Fouquet & Henrik Bettermann
4## This program is free software; you can redistribute it and/or modify
5## it under the terms of the GNU General Public License as published by
6## the Free Software Foundation; either version 2 of the License, or
7## (at your option) any later version.
8##
9## This program is distributed in the hope that it will be useful,
10## but WITHOUT ANY WARRANTY; without even the implied warranty of
11## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12## GNU General Public License for more details.
13##
14## You should have received a copy of the GNU General Public License
15## along with this program; if not, write to the Free Software
16## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17##
18
19from zope import schema
20from waeup.kofa.students.vocabularies import StudyLevelSource
21from waeup.kofa.interfaces import (IKofaObject, academic_sessions_vocab)
22from waeup.kofa.schema import FormattedDate
23from kofacustom.nigeria.students.interfaces import (
24    INigeriaStudentBase, INigeriaUGStudentClearance, INigeriaPGStudentClearance,
25    INigeriaStudentPersonal, INigeriaStudentStudyLevel,
26    INigeriaStudentStudyCourse, INigeriaCourseTicket,
27    INigeriaStudentUpdateByRegNo, INigeriaStudentUpdateByMatricNo,
28    )
29from kofacustom.edocons.payments.interfaces import ICustomOnlinePayment
30from kofacustom.edocons.interfaces import MessageFactory as _
31
32class ICustomStudentBase(INigeriaStudentBase):
33    """Representation of student base data.
34
35    """
36
37class ICustomStudentPersonal(INigeriaStudentPersonal):
38    """Student personal data.
39
40    """
41
42class ICustomUGStudentClearance(INigeriaUGStudentClearance):
43    """Representation of ug student clearance data.
44
45    """
46
47class ICustomPGStudentClearance(INigeriaPGStudentClearance):
48    """Representation of pg student clearance data.
49
50    """
51
52
53class ICustomStudent(ICustomStudentBase,ICustomUGStudentClearance,
54    ICustomPGStudentClearance,ICustomStudentPersonal):
55    """Representation of a student.
56
57    """
58
59class ICustomStudentStudyCourse(INigeriaStudentStudyCourse):
60    """A container for student study levels.
61
62    """
63
64class ICustomStudentStudyLevel(INigeriaStudentStudyLevel):
65    """A container for course tickets.
66
67    """
68
69class ICustomStudentOnlinePayment(ICustomOnlinePayment):
70    """A student payment via payment gateways.
71
72    This Interface does not inherit from IStudentOnlinePayment.
73    Thus all fields from IStudentOnlinePayment have to be repeated here.
74    """
75
76    p_current = schema.Bool(
77        title = _(u'Current Session Payment'),
78        default = True,
79        required = False,
80        )
81
82    p_level = schema.Choice(
83        title = _(u'Payment Level'),
84        source = StudyLevelSource(),
85        required = False,
86        )
87
88ICustomStudentOnlinePayment['p_level'].order = ICustomStudentOnlinePayment[
89    'p_session'].order
90
91class ICustomCourseTicket(INigeriaCourseTicket):
92    """A course ticket.
93
94    """
95
96    automatic = schema.Bool(
97        title = _(u'Automatical Creation'),
98        default = False,
99        required = False,
100        )
101
102    carry_over = schema.Bool(
103        title = _(u'Carry-over Course'),
104        default = False,
105        required = False,
106        )
107
108    carryover_score = schema.Int(
109        title = _(u'Carry-over (RST) Score'),
110        default = None,
111        required = False,
112        missing_value = None,
113        max = 100,
114        )
115
116    carryover_grade = schema.TextLine(
117        title = _(u'Carry-over (RST) Grade'),
118        required = False,
119        default = None,
120        missing_value = None,
121        )
122
123    attempts = schema.Int(
124        title = _(u'Number of Attempts'),
125        default = None,
126        required = False,
127        missing_value = None,
128        max = 5,
129        )
130
131    in_progress = schema.Bool(
132        title = _(u'Course in Progress'),
133        default = False,
134        required = False,
135        )
136
137    resumption_date = FormattedDate(
138        title = _(u'Resumption Date'),
139        required = False,
140        show_year = True,
141        )
142
143    score = schema.Int(
144        title = _(u'(Final) Score'),
145        default = None,
146        required = False,
147        missing_value = None,
148        )
149
150#ICustomCourseTicket['carryover_score'].order = ICustomCourseTicket['carry_over'].order
151#ICustomCourseTicket['in_progress'].order = ICustomCourseTicket['grade'].order
152#ICustomCourseTicket['resumption_date'].order = ICustomCourseTicket['grade'].order
153
154class ICustomCourseTicketImport(ICustomCourseTicket):
155    """An interface for importing course results and nothing more.
156    """
157
158    score = schema.Int(
159        title = _(u'Score'),
160        required = False,
161        readonly = False,
162        )
163
164    level_session = schema.Choice(
165        title = _(u'Level Session'),
166        source = academic_sessions_vocab,
167        required = False,
168        readonly = False,
169        )
170
171class ICustomStudentUpdateByRegNo(INigeriaStudentUpdateByRegNo):
172    """Representation of a student. Skip regular reg_number validation.
173
174    """
175
176class ICustomStudentUpdateByMatricNo(INigeriaStudentUpdateByMatricNo):
177    """Representation of a student. Skip regular matric_number validation.
178
179    """
Note: See TracBrowser for help on using the repository browser.