source: main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/students/interfaces.py @ 16125

Last change on this file since 16125 was 15859, checked in by Henrik Bettermann, 5 years ago

Implement library clearance facilities.

  • Property svn:keywords set to Id
File size: 3.5 KB
Line 
1## $Id: interfaces.py 15859 2019-11-28 08:21:23Z 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 validate_email
22from kofacustom.nigeria.students.interfaces import (
23    INigeriaStudentBase, INigeriaUGStudentClearance, INigeriaPGStudentClearance,
24    INigeriaStudentPersonal, INigeriaStudentStudyLevel,
25    INigeriaStudentStudyCourse, INigeriaCourseTicket,
26    INigeriaStudentUpdateByRegNo, INigeriaStudentUpdateByMatricNo,
27    )
28from kofacustom.iuokada.payments.interfaces import ICustomOnlinePayment
29from kofacustom.iuokada.interfaces import MessageFactory as _
30
31class ICustomStudentBase(INigeriaStudentBase):
32    """Representation of student base data.
33
34    """
35
36    email2 = schema.ASCIILine(
37        title = _(u'Second Email'),
38        required = False,
39        constraint=validate_email,
40        )
41
42    library = schema.Bool(
43        title = _(u'Library Id Card'),
44        default = False,
45        required = False,
46        )
47
48ICustomStudentBase['email2'].order = ICustomStudentBase[
49    'phone'].order
50ICustomStudentBase['phone'].order = ICustomStudentBase[
51    'email'].order
52
53class ICustomStudentPersonal(INigeriaStudentPersonal):
54    """Student personal data.
55
56    """
57
58class ICustomUGStudentClearance(INigeriaUGStudentClearance):
59    """Representation of ug student clearance data.
60
61    """
62
63class ICustomPGStudentClearance(INigeriaPGStudentClearance):
64    """Representation of pg student clearance data.
65
66    """
67
68
69class ICustomStudent(ICustomStudentBase,ICustomUGStudentClearance,
70    ICustomPGStudentClearance,ICustomStudentPersonal):
71    """Representation of a student.
72
73    """
74
75class ICustomStudentStudyCourse(INigeriaStudentStudyCourse):
76    """A container for student study levels.
77
78    """
79
80class ICustomStudentStudyLevel(INigeriaStudentStudyLevel):
81    """A container for course tickets.
82
83    """
84
85class ICustomStudentOnlinePayment(ICustomOnlinePayment):
86    """A student payment via payment gateways.
87
88    This Interface does not inherit from IStudentOnlinePayment.
89    Thus all fields from IStudentOnlinePayment have to be repeated here.
90    """
91
92    p_current = schema.Bool(
93        title = _(u'Current Session Payment'),
94        default = True,
95        required = False,
96        )
97
98    p_level = schema.Choice(
99        title = _(u'Payment Level'),
100        source = StudyLevelSource(),
101        required = False,
102        )
103
104ICustomStudentOnlinePayment['p_level'].order = ICustomStudentOnlinePayment[
105    'p_session'].order
106
107class ICustomCourseTicket(INigeriaCourseTicket):
108    """A course ticket.
109
110    """
111
112class ICustomStudentUpdateByRegNo(INigeriaStudentUpdateByRegNo):
113    """Representation of a student. Skip regular reg_number validation.
114
115    """
116
117class ICustomStudentUpdateByMatricNo(INigeriaStudentUpdateByMatricNo):
118    """Representation of a student. Skip regular matric_number validation.
119
120    """
Note: See TracBrowser for help on using the repository browser.