[7853] | 1 | ## $Id: interfaces.py 9057 2012-07-26 15:14:45Z 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 | |
---|
[8012] | 21 | from zope import schema |
---|
[8051] | 22 | from waeup.kofa.applicants.interfaces import ( |
---|
[8053] | 23 | IApplicantBaseData, |
---|
[8051] | 24 | AppCatCertificateSource, CertificateSource) |
---|
| 25 | from waeup.kofa.schoolgrades import ResultEntryField |
---|
[8530] | 26 | from waeup.kofa.interfaces import ( |
---|
| 27 | SimpleKofaVocabulary, academic_sessions_vocab, validate_email) |
---|
| 28 | from waeup.kofa.schema import FormattedDate, TextLineChoice |
---|
| 29 | from waeup.kofa.students.vocabularies import nats_vocab, GenderSource |
---|
| 30 | from waeup.kofa.applicants.interfaces import contextual_reg_num_source |
---|
[8928] | 31 | from kofacustom.nigeria.applicants.interfaces import ( |
---|
| 32 | LGASource, high_qual, high_grade, exam_types, |
---|
| 33 | INigeriaUGApplicant, INigeriaPGApplicant, |
---|
| 34 | INigeriaApplicantOnlinePayment, |
---|
[9006] | 35 | INigeriaUGApplicantEdit, INigeriaPGApplicantEdit, |
---|
| 36 | INigeriaApplicantUpdateByRegNo, |
---|
| 37 | IPUTMEApplicantEdit, |
---|
[8928] | 38 | ) |
---|
[8020] | 39 | from waeup.uniben.interfaces import MessageFactory as _ |
---|
[8247] | 40 | from waeup.uniben.payments.interfaces import ICustomOnlinePayment |
---|
[7853] | 41 | |
---|
[8928] | 42 | class ICustomUGApplicant(INigeriaUGApplicant): |
---|
[8012] | 43 | """An undergraduate applicant. |
---|
| 44 | |
---|
[8519] | 45 | This interface defines the least common multiple of all fields |
---|
| 46 | in ug application forms. In customized forms, fields can be excluded by |
---|
| 47 | adding them to the UG_OMIT* tuples. |
---|
[8012] | 48 | """ |
---|
| 49 | |
---|
[8928] | 50 | class ICustomPGApplicant(INigeriaPGApplicant): |
---|
[7853] | 51 | """A postgraduate applicant. |
---|
| 52 | |
---|
[8519] | 53 | This interface defines the least common multiple of all fields |
---|
| 54 | in pg application forms. In customized forms, fields can be excluded by |
---|
| 55 | adding them to the PG_OMIT* tuples. |
---|
[7866] | 56 | """ |
---|
| 57 | |
---|
[8012] | 58 | |
---|
[8928] | 59 | class ICustomApplicant(ICustomUGApplicant, ICustomPGApplicant): |
---|
[8012] | 60 | """An interface for both types of applicants. |
---|
| 61 | |
---|
[8928] | 62 | Attention: The ICustomPGApplicant field seetings will be overwritten |
---|
| 63 | by ICustomPGApplicant field settings. If a field is defined |
---|
[8727] | 64 | in both interfaces zope.schema validates only against the |
---|
[8928] | 65 | constraints in ICustomUGApplicant. This does not affect the forms |
---|
| 66 | since they are build on either ICustomUGApplicant or ICustomPGApplicant. |
---|
[8012] | 67 | """ |
---|
| 68 | |
---|
[8743] | 69 | def writeLogMessage(view, comment): |
---|
[8053] | 70 | """Adds an INFO message to the log file |
---|
| 71 | """ |
---|
| 72 | |
---|
| 73 | def createStudent(): |
---|
[8668] | 74 | """Create a student object from applicant data |
---|
[8053] | 75 | and copy applicant object. |
---|
| 76 | """ |
---|
| 77 | |
---|
[9056] | 78 | class ICustomUGApplicantEdit(INigeriaUGApplicantEdit): |
---|
[8727] | 79 | """An undergraduate applicant interface for edit forms. |
---|
[8012] | 80 | |
---|
| 81 | Here we can repeat the fields from base data and set the |
---|
| 82 | `required` and `readonly` attributes to True to further restrict |
---|
| 83 | the data access. Or we can allow only certain certificates to be |
---|
| 84 | selected by choosing the appropriate source. |
---|
| 85 | |
---|
| 86 | We cannot omit fields here. This has to be done in the |
---|
| 87 | respective form page. |
---|
| 88 | """ |
---|
| 89 | |
---|
[9056] | 90 | class ICustomPGApplicantEdit(INigeriaPGApplicantEdit): |
---|
[7866] | 91 | """A postgraduate applicant interface for editing. |
---|
| 92 | |
---|
| 93 | Here we can repeat the fields from base data and set the |
---|
| 94 | `required` and `readonly` attributes to True to further restrict |
---|
| 95 | the data access. Or we can allow only certain certificates to be |
---|
| 96 | selected by choosing the appropriate source. |
---|
| 97 | |
---|
| 98 | We cannot omit fields here. This has to be done in the |
---|
| 99 | respective form page. |
---|
[8017] | 100 | """ |
---|
[8454] | 101 | |
---|
[8928] | 102 | class ICustomApplicantOnlinePayment(INigeriaApplicantOnlinePayment): |
---|
[8247] | 103 | """An applicant payment via payment gateways. |
---|
| 104 | |
---|
| 105 | """ |
---|
[8530] | 106 | |
---|
[9056] | 107 | class IPUTMEApplicantEdit(IPUTMEApplicantEdit): |
---|
[8530] | 108 | """An undergraduate applicant interface for editing. |
---|
| 109 | |
---|
| 110 | Here we can repeat the fields from base data and set the |
---|
| 111 | `required` and `readonly` attributes to True to further restrict |
---|
| 112 | the data access. Or we can allow only certain certificates to be |
---|
| 113 | selected by choosing the appropriate source. |
---|
| 114 | |
---|
| 115 | We cannot omit fields here. This has to be done in the |
---|
| 116 | respective form page. |
---|
| 117 | """ |
---|
| 118 | |
---|
[9056] | 119 | class ICustomApplicantUpdateByRegNo(INigeriaApplicantUpdateByRegNo): |
---|
[8582] | 120 | """Representation of an applicant. |
---|
| 121 | |
---|
| 122 | Skip regular reg_number validation if reg_number is used for finding |
---|
| 123 | the applicant object. |
---|
| 124 | """ |
---|