1 | ## $Id: interfaces.py 10350 2013-06-22 21:39:00Z henrik $ |
---|
2 | ## |
---|
3 | ## Copyright (C) 2011 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 | """Customized interfaces of the university application package. |
---|
19 | """ |
---|
20 | |
---|
21 | from zope import schema |
---|
22 | from zope.interface import Attribute, invariant, Invalid |
---|
23 | from waeup.kofa.applicants.interfaces import ( |
---|
24 | IApplicantBaseData, |
---|
25 | AppCatCertificateSource, CertificateSource) |
---|
26 | from waeup.kofa.students.vocabularies import nats_vocab |
---|
27 | from kofacustom.nigeria.applicants.interfaces import ( |
---|
28 | LGASource, |
---|
29 | high_qual, high_grade, exam_types, |
---|
30 | INigeriaUGApplicant, |
---|
31 | INigeriaApplicantOnlinePayment, |
---|
32 | INigeriaUGApplicantEdit, INigeriaPGApplicantEdit, |
---|
33 | INigeriaApplicantUpdateByRegNo, |
---|
34 | ) |
---|
35 | |
---|
36 | from waeup.imostate.interfaces import MessageFactory as _ |
---|
37 | |
---|
38 | class ICustomUGApplicant(INigeriaUGApplicant): |
---|
39 | """An undergraduate applicant. |
---|
40 | |
---|
41 | This interface defines the least common multiple of all fields |
---|
42 | in ug application forms. In customized forms, fields can be excluded by |
---|
43 | adding them to the UG_OMIT* tuples. |
---|
44 | """ |
---|
45 | |
---|
46 | class ICustomApplicant(ICustomUGApplicant): |
---|
47 | """An interface for both types of applicants. |
---|
48 | |
---|
49 | Attention: The ICustomPGApplicant field seetings will be overwritten |
---|
50 | by ICustomPGApplicant field settings. If a field is defined |
---|
51 | in both interfaces zope.schema validates only against the |
---|
52 | constraints in ICustomUGApplicant. This does not affect the forms |
---|
53 | since they are build on either ICustomUGApplicant or ICustomPGApplicant. |
---|
54 | """ |
---|
55 | |
---|
56 | def writeLogMessage(view, comment): |
---|
57 | """Adds an INFO message to the log file |
---|
58 | """ |
---|
59 | |
---|
60 | def createStudent(): |
---|
61 | """Create a student object from applicatnt data |
---|
62 | and copy applicant object. |
---|
63 | """ |
---|
64 | |
---|
65 | class ICustomUGApplicantEdit(ICustomUGApplicant): |
---|
66 | """An undergraduate applicant interface for edit forms. |
---|
67 | |
---|
68 | Here we can repeat the fields from base data and set the |
---|
69 | `required` and `readonly` attributes to True to further restrict |
---|
70 | the data access. Or we can allow only certain certificates to be |
---|
71 | selected by choosing the appropriate source. |
---|
72 | |
---|
73 | We cannot omit fields here. This has to be done in the |
---|
74 | respective form page. |
---|
75 | """ |
---|
76 | |
---|
77 | |
---|
78 | class ICustomApplicantOnlinePayment(INigeriaApplicantOnlinePayment): |
---|
79 | """An applicant payment via payment gateways. |
---|
80 | |
---|
81 | """ |
---|
82 | |
---|
83 | class ICustomApplicantUpdateByRegNo(INigeriaApplicantUpdateByRegNo): |
---|
84 | """Representation of an applicant. |
---|
85 | |
---|
86 | Skip regular reg_number validation if reg_number is used for finding |
---|
87 | the applicant object. |
---|
88 | """ |
---|
89 | |
---|