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

Last change on this file since 17405 was 17405, checked in by Henrik Bettermann, 17 months ago

New fields.

  • Property svn:keywords set to Id
File size: 4.6 KB
Line 
1## $Id: interfaces.py 17405 2023-05-08 17:21:10Z 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    carryover_score = schema.Int(
97        title = _(u'Carry-over Score'),
98        default = None,
99        required = False,
100        missing_value = None,
101        max = 100,
102        )
103
104    attempted_number = schema.Int(
105        title = _(u'Attempted Number'),
106        default = None,
107        required = False,
108        missing_value = None,
109        max = 5,
110        )
111
112    rst_grade = schema.TextLine(
113        title = _(u'RST Grade'),
114        required = False,
115        )
116
117    in_progress = schema.Bool(
118        title = _(u'Course in Progress'),
119        default = False,
120        required = False,
121        )
122
123    resumption_date = FormattedDate(
124        title = _(u'Resumption Date'),
125        required = False,
126        show_year = True,
127        )
128
129ICustomCourseTicket['carryover_score'].order = ICustomCourseTicket['carry_over'].order
130#ICustomCourseTicket['in_progress'].order = ICustomCourseTicket['grade'].order
131#ICustomCourseTicket['resumption_date'].order = ICustomCourseTicket['grade'].order
132
133class ICustomCourseTicketImport(ICustomCourseTicket):
134    """An interface for importing course results and nothing more.
135    """
136
137    score = schema.Int(
138        title = _(u'Score'),
139        required = False,
140        readonly = False,
141        )
142
143    level_session = schema.Choice(
144        title = _(u'Level Session'),
145        source = academic_sessions_vocab,
146        required = False,
147        readonly = False,
148        )
149
150class ICustomStudentUpdateByRegNo(INigeriaStudentUpdateByRegNo):
151    """Representation of a student. Skip regular reg_number validation.
152
153    """
154
155class ICustomStudentUpdateByMatricNo(INigeriaStudentUpdateByMatricNo):
156    """Representation of a student. Skip regular matric_number validation.
157
158    """
Note: See TracBrowser for help on using the repository browser.