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

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

Add email2 field.

Fix tests.

  • Property svn:keywords set to Id
File size: 3.4 KB
Line 
1## $Id: interfaces.py 15704 2019-10-28 07:12:20Z 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
42ICustomStudentBase['email2'].order = ICustomStudentBase[
43    'phone'].order
44ICustomStudentBase['phone'].order = ICustomStudentBase[
45    'email'].order
46
47class ICustomStudentPersonal(INigeriaStudentPersonal):
48    """Student personal data.
49
50    """
51
52class ICustomUGStudentClearance(INigeriaUGStudentClearance):
53    """Representation of ug student clearance data.
54
55    """
56
57class ICustomPGStudentClearance(INigeriaPGStudentClearance):
58    """Representation of pg student clearance data.
59
60    """
61
62
63class ICustomStudent(ICustomStudentBase,ICustomUGStudentClearance,
64    ICustomPGStudentClearance,ICustomStudentPersonal):
65    """Representation of a student.
66
67    """
68
69class ICustomStudentStudyCourse(INigeriaStudentStudyCourse):
70    """A container for student study levels.
71
72    """
73
74class ICustomStudentStudyLevel(INigeriaStudentStudyLevel):
75    """A container for course tickets.
76
77    """
78
79class ICustomStudentOnlinePayment(ICustomOnlinePayment):
80    """A student payment via payment gateways.
81
82    This Interface does not inherit from IStudentOnlinePayment.
83    Thus all fields from IStudentOnlinePayment have to be repeated here.
84    """
85
86    p_current = schema.Bool(
87        title = _(u'Current Session Payment'),
88        default = True,
89        required = False,
90        )
91
92    p_level = schema.Choice(
93        title = _(u'Payment Level'),
94        source = StudyLevelSource(),
95        required = False,
96        )
97
98ICustomStudentOnlinePayment['p_level'].order = ICustomStudentOnlinePayment[
99    'p_session'].order
100
101class ICustomCourseTicket(INigeriaCourseTicket):
102    """A course ticket.
103
104    """
105
106class ICustomStudentUpdateByRegNo(INigeriaStudentUpdateByRegNo):
107    """Representation of a student. Skip regular reg_number validation.
108
109    """
110
111class ICustomStudentUpdateByMatricNo(INigeriaStudentUpdateByMatricNo):
112    """Representation of a student. Skip regular matric_number validation.
113
114    """
Note: See TracBrowser for help on using the repository browser.