[7853] | 1 | ## $Id: interfaces.py 9059 2012-07-26 15:16:10Z 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 |
---|
[8531] | 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 |
---|
[8933] | 31 | from kofacustom.nigeria.applicants.interfaces import ( |
---|
| 32 | LGASource, high_qual, high_grade, exam_types, |
---|
| 33 | INigeriaUGApplicant, INigeriaPGApplicant, |
---|
| 34 | INigeriaApplicantOnlinePayment, |
---|
[8979] | 35 | INigeriaUGApplicantEdit, INigeriaPGApplicantEdit, |
---|
| 36 | INigeriaApplicantUpdateByRegNo, |
---|
| 37 | IPUTMEApplicantEdit, |
---|
[8933] | 38 | ) |
---|
[8460] | 39 | from waeup.fceokene.interfaces import MessageFactory as _ |
---|
| 40 | from waeup.fceokene.payments.interfaces import ICustomOnlinePayment |
---|
[7853] | 41 | |
---|
[8933] | 42 | class ICustomUGApplicant(INigeriaUGApplicant): |
---|
[8012] | 43 | """An undergraduate applicant. |
---|
| 44 | |
---|
[8520] | 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 | |
---|
[8933] | 50 | class ICustomPGApplicant(INigeriaPGApplicant): |
---|
[7853] | 51 | """A postgraduate applicant. |
---|
| 52 | |
---|
[8520] | 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 | |
---|
[8933] | 58 | class ICustomApplicant(ICustomUGApplicant, ICustomPGApplicant): |
---|
[8012] | 59 | """An interface for both types of applicants. |
---|
| 60 | |
---|
[8933] | 61 | Attention: The ICustomPGApplicant field seetings will be overwritten |
---|
| 62 | by ICustomPGApplicant field settings. If a field is defined |
---|
[8729] | 63 | in both interfaces zope.schema validates only against the |
---|
[8933] | 64 | constraints in ICustomUGApplicant. This does not affect the forms |
---|
| 65 | since they are build on either ICustomUGApplicant or ICustomPGApplicant. |
---|
[8012] | 66 | """ |
---|
| 67 | |
---|
[8745] | 68 | def writeLogMessage(view, comment): |
---|
[8053] | 69 | """Adds an INFO message to the log file |
---|
| 70 | """ |
---|
| 71 | |
---|
| 72 | def createStudent(): |
---|
| 73 | """Create a student object from applicatnt data |
---|
| 74 | and copy applicant object. |
---|
| 75 | """ |
---|
| 76 | |
---|
[8979] | 77 | class ICustomUGApplicantEdit(INigeriaUGApplicantEdit): |
---|
[8729] | 78 | """An undergraduate applicant interface for edit forms. |
---|
[8012] | 79 | |
---|
| 80 | Here we can repeat the fields from base data and set the |
---|
| 81 | `required` and `readonly` attributes to True to further restrict |
---|
| 82 | the data access. Or we can allow only certain certificates to be |
---|
| 83 | selected by choosing the appropriate source. |
---|
| 84 | |
---|
| 85 | We cannot omit fields here. This has to be done in the |
---|
| 86 | respective form page. |
---|
| 87 | """ |
---|
| 88 | |
---|
[8979] | 89 | class ICustomPGApplicantEdit(INigeriaPGApplicantEdit): |
---|
[7866] | 90 | """A postgraduate applicant interface for editing. |
---|
| 91 | |
---|
| 92 | Here we can repeat the fields from base data and set the |
---|
| 93 | `required` and `readonly` attributes to True to further restrict |
---|
| 94 | the data access. Or we can allow only certain certificates to be |
---|
| 95 | selected by choosing the appropriate source. |
---|
| 96 | |
---|
| 97 | We cannot omit fields here. This has to be done in the |
---|
| 98 | respective form page. |
---|
[8017] | 99 | """ |
---|
[8454] | 100 | |
---|
[8933] | 101 | class ICustomApplicantOnlinePayment(INigeriaApplicantOnlinePayment): |
---|
[8247] | 102 | """An applicant payment via payment gateways. |
---|
| 103 | |
---|
| 104 | """ |
---|
[8531] | 105 | |
---|
[8979] | 106 | class IPUTMEApplicantEdit(IPUTMEApplicantEdit): |
---|
[8531] | 107 | """An undergraduate applicant interface for editing. |
---|
| 108 | |
---|
| 109 | Here we can repeat the fields from base data and set the |
---|
| 110 | `required` and `readonly` attributes to True to further restrict |
---|
| 111 | the data access. Or we can allow only certain certificates to be |
---|
| 112 | selected by choosing the appropriate source. |
---|
| 113 | |
---|
| 114 | We cannot omit fields here. This has to be done in the |
---|
| 115 | respective form page. |
---|
| 116 | """ |
---|
| 117 | |
---|
[8979] | 118 | class ICustomApplicantUpdateByRegNo(INigeriaApplicantUpdateByRegNo): |
---|
[8584] | 119 | """Representation of an applicant. |
---|
| 120 | |
---|
| 121 | Skip regular reg_number validation if reg_number is used for finding |
---|
| 122 | the applicant object. |
---|
| 123 | """ |
---|
[8979] | 124 | |
---|