source: main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/students/interfaces.py @ 11115

Last change on this file since 11115 was 10710, checked in by Henrik Bettermann, 11 years ago

Add ICustomStudentPersonalEdit. Use custom interfaces in browser components.

  • Property svn:keywords set to Id
File size: 4.2 KB
Line 
1## $Id: interfaces.py 10710 2013-11-06 17:15:39Z 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 kofacustom.nigeria.students.interfaces import (
21    INigeriaStudentBase, INigeriaUGStudentClearance, INigeriaPGStudentClearance,
22    INigeriaStudentPersonal, INigeriaStudentStudyLevel,
23    INigeriaStudentStudyCourse, INigeriaCourseTicket,
24    INigeriaStudentUpdateByRegNo, INigeriaStudentUpdateByMatricNo,
25    )
26from waeup.kwarapoly.payments.interfaces import ICustomOnlinePayment
27from waeup.kwarapoly.interfaces import MessageFactory as _
28
29class ICustomStudentBase(INigeriaStudentBase):
30    """Representation of student base data.
31
32    """
33
34class ICustomStudentPersonal(INigeriaStudentPersonal):
35    """Student personal data.
36
37    """
38
39    perm_address = schema.Text(
40        title = _(u'Home Address'),
41        required = False,
42        )
43
44    corr_address = schema.Text(
45        title = _(u'Correspondence Address'),
46        required = False,
47        )
48
49    sponsor_name = schema.TextLine(
50        title = _(u'Sponsor\'s Name'),
51        required = False,
52        readonly = False,
53        )
54
55    sponsor_address = schema.Text(
56        title = _(u'Sponsor\'s Address'),
57        required = False,
58        readonly = False,
59        )
60
61class ICustomStudentPersonalEdit(ICustomStudentPersonal):
62    """Interface for editing personal data by students.
63
64    Here we can repeat the fields from IStudentPersonal and set the
65    `required` if necessary.
66    """
67
68    perm_address = schema.Text(
69        title = _(u'Home Address'),
70        required = True,
71        )
72
73    corr_address = schema.Text(
74        title = _(u'Correspondence Address'),
75        required = True,
76        )
77
78    sponsor_name = schema.TextLine(
79        title = _(u'Sponsor\'s Name'),
80        required = False,
81        readonly = False,
82        )
83
84    sponsor_address = schema.Text(
85        title = _(u'Sponsor\'s Address'),
86        required = False,
87        readonly = False,
88        )
89
90class ICustomUGStudentClearance(INigeriaUGStudentClearance):
91    """Representation of ug student clearance data.
92
93    """
94
95class ICustomPGStudentClearance(INigeriaPGStudentClearance):
96    """Representation of pg student clearance data.
97
98    """
99
100
101class ICustomStudent(ICustomStudentBase,ICustomUGStudentClearance,
102    ICustomPGStudentClearance,ICustomStudentPersonal):
103    """Representation of a student.
104
105    """
106
107class ICustomStudentStudyCourse(INigeriaStudentStudyCourse):
108    """A container for student study levels.
109
110    """
111
112class ICustomStudentStudyLevel(INigeriaStudentStudyLevel):
113    """A container for course tickets.
114
115    """
116
117class ICustomStudentOnlinePayment(ICustomOnlinePayment):
118    """A student payment via payment gateways.
119
120    This Interface does not inherit from IStudentOnlinePayment.
121    Thus all fields from IStudentOnlinePayment have to be repeated here.
122    """
123
124    p_current = schema.Bool(
125        title = _(u'Current Session Payment'),
126        default = True,
127        required = False,
128        )
129
130    p_level = schema.Int(
131        title = _(u'Payment Level'),
132        required = False,
133        )
134
135ICustomStudentOnlinePayment['p_level'].order = ICustomStudentOnlinePayment[
136    'p_session'].order
137
138class ICustomCourseTicket(INigeriaCourseTicket):
139    """A course ticket.
140
141    """
142
143class ICustomStudentUpdateByRegNo(INigeriaStudentUpdateByRegNo):
144    """Representation of a student. Skip regular reg_number validation.
145
146    """
147
148class ICustomStudentUpdateByMatricNo(INigeriaStudentUpdateByMatricNo):
149    """Representation of a student. Skip regular matric_number validation.
150
151    """
Note: See TracBrowser for help on using the repository browser.