source: main/waeup.uniben/trunk/src/waeup/uniben/students/interfaces.py @ 14395

Last change on this file since 14395 was 13741, checked in by Henrik Bettermann, 9 years ago

Show certificate-specific p_level value on payment pages.

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