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

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

Add fields and change field names.

  • Property svn:keywords set to Id
File size: 5.0 KB
RevLine 
[16639]1## $Id: interfaces.py 17406 2023-05-09 15:19:08Z henrik $
[15614]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
[17346]21from waeup.kofa.interfaces import (IKofaObject, academic_sessions_vocab)
[17363]22from waeup.kofa.schema import FormattedDate
[15614]23from kofacustom.nigeria.students.interfaces import (
24    INigeriaStudentBase, INigeriaUGStudentClearance, INigeriaPGStudentClearance,
25    INigeriaStudentPersonal, INigeriaStudentStudyLevel,
26    INigeriaStudentStudyCourse, INigeriaCourseTicket,
27    INigeriaStudentUpdateByRegNo, INigeriaStudentUpdateByMatricNo,
28    )
[16615]29from kofacustom.edocons.payments.interfaces import ICustomOnlinePayment
30from kofacustom.edocons.interfaces import MessageFactory as _
[15614]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
[17406]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
[17345]108    carryover_score = schema.Int(
[17406]109        title = _(u'Carry-over (RST) Score'),
[17345]110        default = None,
111        required = False,
112        missing_value = None,
113        max = 100,
114        )
115
[17406]116    carryover_grade = schema.TextLine(
117        title = _(u'Carry-over (RST) Grade'),
118        required = False,
119        )
120
121    attempts = schema.Int(
122        title = _(u'Number of Attempts'),
[17405]123        default = None,
124        required = False,
125        missing_value = None,
126        max = 5,
127        )
128
[17363]129    in_progress = schema.Bool(
[17405]130        title = _(u'Course in Progress'),
[17363]131        default = False,
132        required = False,
133        )
134
135    resumption_date = FormattedDate(
136        title = _(u'Resumption Date'),
137        required = False,
138        show_year = True,
139        )
140
[17406]141    score = schema.Int(
142        title = _(u'(Final) Score'),
143        default = None,
144        required = False,
145        missing_value = None,
146        )
147
148#ICustomCourseTicket['carryover_score'].order = ICustomCourseTicket['carry_over'].order
[17363]149#ICustomCourseTicket['in_progress'].order = ICustomCourseTicket['grade'].order
150#ICustomCourseTicket['resumption_date'].order = ICustomCourseTicket['grade'].order
[17345]151
[17346]152class ICustomCourseTicketImport(ICustomCourseTicket):
153    """An interface for importing course results and nothing more.
154    """
155
156    score = schema.Int(
157        title = _(u'Score'),
158        required = False,
159        readonly = False,
160        )
161
162    level_session = schema.Choice(
163        title = _(u'Level Session'),
164        source = academic_sessions_vocab,
165        required = False,
166        readonly = False,
167        )
168
[15614]169class ICustomStudentUpdateByRegNo(INigeriaStudentUpdateByRegNo):
170    """Representation of a student. Skip regular reg_number validation.
171
172    """
173
174class ICustomStudentUpdateByMatricNo(INigeriaStudentUpdateByMatricNo):
175    """Representation of a student. Skip regular matric_number validation.
176
177    """
Note: See TracBrowser for help on using the repository browser.