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

Last change on this file since 11683 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
RevLine 
[7505]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##
[8868]18
[7505]19from zope import schema
[8868]20from kofacustom.nigeria.students.interfaces import (
21    INigeriaStudentBase, INigeriaUGStudentClearance, INigeriaPGStudentClearance,
22    INigeriaStudentPersonal, INigeriaStudentStudyLevel,
23    INigeriaStudentStudyCourse, INigeriaCourseTicket,
24    INigeriaStudentUpdateByRegNo, INigeriaStudentUpdateByMatricNo,
[7505]25    )
[9347]26from waeup.kwarapoly.payments.interfaces import ICustomOnlinePayment
27from waeup.kwarapoly.interfaces import MessageFactory as _
[7505]28
[8868]29class ICustomStudentBase(INigeriaStudentBase):
[7618]30    """Representation of student base data.
[7505]31
32    """
[7618]33
[8868]34class ICustomStudentPersonal(INigeriaStudentPersonal):
[7618]35    """Student personal data.
36
37    """
38
[10705]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
[10710]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
[8868]90class ICustomUGStudentClearance(INigeriaUGStudentClearance):
[7995]91    """Representation of ug student clearance data.
[7505]92
93    """
94
[8868]95class ICustomPGStudentClearance(INigeriaPGStudentClearance):
[7995]96    """Representation of pg student clearance data.
[7505]97
98    """
99
[8101]100
[8204]101class ICustomStudent(ICustomStudentBase,ICustomUGStudentClearance,
102    ICustomPGStudentClearance,ICustomStudentPersonal):
[7995]103    """Representation of a student.
[7505]104
105    """
[8247]106
[8868]107class ICustomStudentStudyCourse(INigeriaStudentStudyCourse):
[8326]108    """A container for student study levels.
109
110    """
111
[8868]112class ICustomStudentStudyLevel(INigeriaStudentStudyLevel):
[8326]113    """A container for course tickets.
114
115    """
116
[8247]117class ICustomStudentOnlinePayment(ICustomOnlinePayment):
118    """A student payment via payment gateways.
119
[8270]120    This Interface does not inherit from IStudentOnlinePayment.
121    Thus all fields from IStudentOnlinePayment have to be repeated here.
122    """
123
[9153]124    p_current = schema.Bool(
125        title = _(u'Current Session Payment'),
126        default = True,
127        required = False,
128        )
129
[8270]130    p_level = schema.Int(
131        title = _(u'Payment Level'),
132        required = False,
133        )
[8430]134
[8270]135ICustomStudentOnlinePayment['p_level'].order = ICustomStudentOnlinePayment[
[8326]136    'p_session'].order
137
[8868]138class ICustomCourseTicket(INigeriaCourseTicket):
[8326]139    """A course ticket.
140
[8584]141    """
142
[8868]143class ICustomStudentUpdateByRegNo(INigeriaStudentUpdateByRegNo):
[8584]144    """Representation of a student. Skip regular reg_number validation.
145
146    """
147
[8868]148class ICustomStudentUpdateByMatricNo(INigeriaStudentUpdateByMatricNo):
[8584]149    """Representation of a student. Skip regular matric_number validation.
150
[8868]151    """
Note: See TracBrowser for help on using the repository browser.