[7853] | 1 | ## $Id: interfaces.py 16005 2020-02-14 10:11:34Z 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 |
---|
[10298] | 22 | from zope.interface import Attribute, invariant, Invalid |
---|
[8051] | 23 | from waeup.kofa.applicants.interfaces import ( |
---|
[8053] | 24 | IApplicantBaseData, |
---|
[8051] | 25 | AppCatCertificateSource, CertificateSource) |
---|
| 26 | from waeup.kofa.schoolgrades import ResultEntryField |
---|
[8532] | 27 | from waeup.kofa.interfaces import ( |
---|
| 28 | SimpleKofaVocabulary, academic_sessions_vocab, validate_email) |
---|
[13544] | 29 | from waeup.kofa.schema import FormattedDate, TextLineChoice, PhoneNumber |
---|
| 30 | from waeup.kofa.interfaces import IKofaObject |
---|
| 31 | from waeup.kofa.students.vocabularies import ( |
---|
| 32 | nats_vocab, GenderSource, StudyLevelSource) |
---|
[10298] | 33 | from waeup.kofa.applicants.interfaces import ( |
---|
| 34 | contextual_reg_num_source, |
---|
| 35 | IApplicantBaseData) |
---|
[13544] | 36 | from waeup.kofa.university.vocabularies import StudyModeSource |
---|
[8931] | 37 | from kofacustom.nigeria.applicants.interfaces import ( |
---|
| 38 | LGASource, high_qual, high_grade, exam_types, |
---|
| 39 | INigeriaUGApplicant, INigeriaPGApplicant, |
---|
| 40 | INigeriaApplicantOnlinePayment, |
---|
[8980] | 41 | INigeriaUGApplicantEdit, INigeriaPGApplicantEdit, |
---|
| 42 | INigeriaApplicantUpdateByRegNo, |
---|
| 43 | IPUTMEApplicantEdit, |
---|
[8931] | 44 | ) |
---|
[8444] | 45 | from waeup.aaue.interfaces import MessageFactory as _ |
---|
| 46 | from waeup.aaue.payments.interfaces import ICustomOnlinePayment |
---|
[7853] | 47 | |
---|
[10924] | 48 | programme_types_vocab = SimpleKofaVocabulary( |
---|
[11542] | 49 | (_('Undergraduate Programme (100 level)'), 'regular'), |
---|
| 50 | (_('Direct Entry (200 level)'), 'direct'), |
---|
[10924] | 51 | (_('not applicable'), 'na'), |
---|
| 52 | ) |
---|
| 53 | |
---|
[15118] | 54 | certificate_types_vocab = SimpleKofaVocabulary( |
---|
| 55 | (_('Full-time Degree'), 'ft'), |
---|
| 56 | (_('Part-time Degree'), 'pt'), |
---|
| 57 | (_('Diploma'), 'dp'), |
---|
| 58 | (_('Masters Degree'), 'ma'), |
---|
| 59 | (_('Doctorate Degree'), 'phd'), |
---|
| 60 | ) |
---|
| 61 | |
---|
[15530] | 62 | document_types_vocab = SimpleKofaVocabulary( |
---|
| 63 | (_('Certificate'), 'certificate'), |
---|
| 64 | (_('Result'), 'result'), |
---|
| 65 | (_('Transcript'), 'transcript'), |
---|
| 66 | (_('Studentship'), 'studship'), |
---|
| 67 | ) |
---|
| 68 | |
---|
[15991] | 69 | application_types_vocab = SimpleKofaVocabulary( |
---|
| 70 | (_('Academic Staff Positions'), 'academic'), |
---|
| 71 | (_('Senior Non-Teaching Staff'), 'senior'), |
---|
| 72 | (_('Junior Staff (Non-Teaching)'), 'junior'), |
---|
| 73 | ) |
---|
| 74 | |
---|
[15740] | 75 | request_types_vocab = SimpleKofaVocabulary( |
---|
| 76 | (_('Scanned Result'), 'result'), |
---|
| 77 | (_('Scanned Certificate'), 'certificate'), |
---|
| 78 | (_('Scanned Transcript'), 'transcript'), |
---|
| 79 | (_('Attestation'), 'attest'), |
---|
| 80 | (_('Proficiency in English Language'), 'english'), |
---|
| 81 | ) |
---|
| 82 | |
---|
[10298] | 83 | class ICustomUGApplicant(IApplicantBaseData): |
---|
[8012] | 84 | """An undergraduate applicant. |
---|
| 85 | |
---|
[8521] | 86 | This interface defines the least common multiple of all fields |
---|
| 87 | in ug application forms. In customized forms, fields can be excluded by |
---|
| 88 | adding them to the UG_OMIT* tuples. |
---|
[8012] | 89 | """ |
---|
| 90 | |
---|
[13977] | 91 | #programme_type = schema.Choice( |
---|
| 92 | # title = _(u'Programme Type'), |
---|
| 93 | # vocabulary = programme_types_vocab, |
---|
| 94 | # required = False, |
---|
| 95 | # ) |
---|
[10924] | 96 | |
---|
[10298] | 97 | nationality = schema.Choice( |
---|
| 98 | source = nats_vocab, |
---|
| 99 | title = _(u'Nationality'), |
---|
| 100 | required = True, |
---|
| 101 | ) |
---|
[14829] | 102 | |
---|
[10298] | 103 | lga = schema.Choice( |
---|
| 104 | source = LGASource(), |
---|
| 105 | title = _(u'State/LGA (Nigerians only)'), |
---|
| 106 | required = False, |
---|
| 107 | ) |
---|
[14829] | 108 | |
---|
[10298] | 109 | perm_address = schema.Text( |
---|
| 110 | title = _(u'Permanent Address'), |
---|
| 111 | required = False, |
---|
| 112 | ) |
---|
[14829] | 113 | |
---|
[10308] | 114 | home_town = schema.TextLine( |
---|
[10306] | 115 | title = _(u'Home Town'), |
---|
| 116 | required = False, |
---|
| 117 | ) |
---|
[14829] | 118 | |
---|
[13977] | 119 | #jamb_reg_number = schema.TextLine( |
---|
| 120 | # title = _(u'JAMB Registration Number'), |
---|
| 121 | # required = False, |
---|
| 122 | # ) |
---|
[14829] | 123 | |
---|
[10311] | 124 | jamb_score = schema.Int( |
---|
| 125 | title = _(u'Total JAMB Score'), |
---|
| 126 | required = False, |
---|
| 127 | ) |
---|
[14829] | 128 | |
---|
[13977] | 129 | jamb_subjects = schema.Text( |
---|
| 130 | title = _(u'JAMB Subjects and Scores'), |
---|
| 131 | required = False, |
---|
| 132 | ) |
---|
[14829] | 133 | |
---|
[10298] | 134 | course1 = schema.Choice( |
---|
| 135 | title = _(u'1st Choice Course of Study'), |
---|
| 136 | source = AppCatCertificateSource(), |
---|
[14468] | 137 | required = False, |
---|
[10298] | 138 | ) |
---|
[14829] | 139 | |
---|
[10298] | 140 | course2 = schema.Choice( |
---|
| 141 | title = _(u'2nd Choice Course of Study'), |
---|
| 142 | source = AppCatCertificateSource(), |
---|
| 143 | required = False, |
---|
| 144 | ) |
---|
[14829] | 145 | |
---|
[15455] | 146 | course3 = schema.Choice( |
---|
| 147 | title = _(u'3rd Choice Course of Study'), |
---|
| 148 | source = AppCatCertificateSource(), |
---|
| 149 | required = False, |
---|
| 150 | ) |
---|
| 151 | |
---|
[10298] | 152 | fst_sit_fname = schema.TextLine( |
---|
| 153 | title = _(u'Full Name'), |
---|
| 154 | required = False, |
---|
| 155 | readonly = False, |
---|
| 156 | ) |
---|
[14829] | 157 | |
---|
[10298] | 158 | fst_sit_no = schema.TextLine( |
---|
| 159 | title = _(u'Exam Number'), |
---|
| 160 | required = False, |
---|
| 161 | readonly = False, |
---|
| 162 | ) |
---|
[14829] | 163 | |
---|
| 164 | fst_sit_sc_pin = schema.TextLine( |
---|
| 165 | title = _(u'Scratch Card Pin'), |
---|
| 166 | required = False, |
---|
| 167 | readonly = False, |
---|
| 168 | ) |
---|
| 169 | |
---|
| 170 | fst_sit_sc_serial_number = schema.TextLine( |
---|
| 171 | title = _(u'Scratch Card Serial Number'), |
---|
| 172 | required = False, |
---|
| 173 | readonly = False, |
---|
| 174 | ) |
---|
| 175 | |
---|
[10298] | 176 | fst_sit_date = FormattedDate( |
---|
| 177 | title = _(u'Exam Date'), |
---|
| 178 | required = False, |
---|
| 179 | readonly = False, |
---|
| 180 | show_year = True, |
---|
| 181 | ) |
---|
[14829] | 182 | |
---|
[10298] | 183 | fst_sit_type = schema.Choice( |
---|
| 184 | title = _(u'Exam Type'), |
---|
| 185 | required = False, |
---|
| 186 | readonly = False, |
---|
| 187 | vocabulary = exam_types, |
---|
| 188 | ) |
---|
[14829] | 189 | |
---|
[10298] | 190 | fst_sit_results = schema.List( |
---|
| 191 | title = _(u'Exam Results'), |
---|
| 192 | value_type = ResultEntryField(), |
---|
| 193 | required = False, |
---|
| 194 | readonly = False, |
---|
[14017] | 195 | defaultFactory=list, |
---|
[10298] | 196 | ) |
---|
[14829] | 197 | |
---|
[10298] | 198 | scd_sit_fname = schema.TextLine( |
---|
| 199 | title = _(u'Full Name'), |
---|
| 200 | required = False, |
---|
| 201 | readonly = False, |
---|
| 202 | ) |
---|
[14829] | 203 | |
---|
[10298] | 204 | scd_sit_no = schema.TextLine( |
---|
| 205 | title = _(u'Exam Number'), |
---|
| 206 | required = False, |
---|
| 207 | readonly = False, |
---|
| 208 | ) |
---|
[14829] | 209 | |
---|
| 210 | scd_sit_sc_pin = schema.TextLine( |
---|
| 211 | title = _(u'Scratch Card Pin'), |
---|
| 212 | required = False, |
---|
| 213 | readonly = False, |
---|
| 214 | ) |
---|
| 215 | |
---|
| 216 | scd_sit_sc_serial_number = schema.TextLine( |
---|
| 217 | title = _(u'Scratch Card Serial Number'), |
---|
| 218 | required = False, |
---|
| 219 | readonly = False, |
---|
| 220 | ) |
---|
| 221 | |
---|
[10298] | 222 | scd_sit_date = FormattedDate( |
---|
| 223 | title = _(u'Exam Date'), |
---|
| 224 | required = False, |
---|
| 225 | readonly = False, |
---|
| 226 | show_year = True, |
---|
| 227 | ) |
---|
[14829] | 228 | |
---|
[10298] | 229 | scd_sit_type = schema.Choice( |
---|
| 230 | title = _(u'Exam Type'), |
---|
| 231 | required = False, |
---|
| 232 | readonly = False, |
---|
| 233 | vocabulary = exam_types, |
---|
| 234 | ) |
---|
[14829] | 235 | |
---|
[10298] | 236 | scd_sit_results = schema.List( |
---|
| 237 | title = _(u'Exam Results'), |
---|
| 238 | value_type = ResultEntryField(), |
---|
| 239 | required = False, |
---|
| 240 | readonly = False, |
---|
[14017] | 241 | defaultFactory=list, |
---|
[10298] | 242 | ) |
---|
[14829] | 243 | |
---|
[10298] | 244 | alr_fname = schema.TextLine( |
---|
| 245 | title = _(u'Full Name'), |
---|
| 246 | required = False, |
---|
| 247 | readonly = False, |
---|
| 248 | ) |
---|
[14829] | 249 | |
---|
[10298] | 250 | alr_no = schema.TextLine( |
---|
| 251 | title = _(u'Exam Number'), |
---|
| 252 | required = False, |
---|
| 253 | readonly = False, |
---|
| 254 | ) |
---|
[14829] | 255 | |
---|
[10298] | 256 | alr_date = FormattedDate( |
---|
| 257 | title = _(u'Exam Date'), |
---|
| 258 | required = False, |
---|
| 259 | readonly = False, |
---|
| 260 | show_year = True, |
---|
| 261 | ) |
---|
[14829] | 262 | |
---|
[10298] | 263 | alr_results = schema.List( |
---|
| 264 | title = _(u'Exam Results'), |
---|
| 265 | value_type = ResultEntryField(), |
---|
| 266 | required = False, |
---|
| 267 | readonly = False, |
---|
[14017] | 268 | defaultFactory=list, |
---|
[10298] | 269 | ) |
---|
[14829] | 270 | |
---|
[10998] | 271 | hq_type = schema.Choice( |
---|
| 272 | title = _(u'Qualification Obtained'), |
---|
| 273 | required = False, |
---|
| 274 | readonly = False, |
---|
| 275 | vocabulary = high_qual, |
---|
| 276 | ) |
---|
| 277 | |
---|
| 278 | hq_fname = schema.TextLine( |
---|
| 279 | title = _(u'Full Name'), |
---|
| 280 | required = False, |
---|
| 281 | readonly = False, |
---|
| 282 | ) |
---|
| 283 | |
---|
| 284 | hq_matric_no = schema.TextLine( |
---|
| 285 | title = _(u'Former Matric Number'), |
---|
| 286 | required = False, |
---|
| 287 | readonly = False, |
---|
| 288 | ) |
---|
| 289 | |
---|
| 290 | hq_degree = schema.Choice( |
---|
| 291 | title = _(u'Class of Degree'), |
---|
| 292 | required = False, |
---|
| 293 | readonly = False, |
---|
| 294 | vocabulary = high_grade, |
---|
| 295 | ) |
---|
| 296 | |
---|
| 297 | hq_school = schema.TextLine( |
---|
| 298 | title = _(u'Institution Attended'), |
---|
| 299 | required = False, |
---|
| 300 | readonly = False, |
---|
| 301 | ) |
---|
| 302 | |
---|
| 303 | hq_session = schema.TextLine( |
---|
| 304 | title = _(u'Years Attended'), |
---|
| 305 | required = False, |
---|
| 306 | readonly = False, |
---|
| 307 | ) |
---|
| 308 | |
---|
| 309 | hq_disc = schema.TextLine( |
---|
| 310 | title = _(u'Discipline'), |
---|
| 311 | required = False, |
---|
| 312 | readonly = False, |
---|
| 313 | ) |
---|
[13545] | 314 | |
---|
| 315 | hq_type2 = schema.Choice( |
---|
| 316 | title = _(u'Qualification Obtained'), |
---|
| 317 | required = False, |
---|
| 318 | readonly = False, |
---|
| 319 | vocabulary = high_qual, |
---|
| 320 | ) |
---|
| 321 | |
---|
| 322 | hq_fname2 = schema.TextLine( |
---|
| 323 | title = _(u'Full Name'), |
---|
| 324 | required = False, |
---|
| 325 | readonly = False, |
---|
| 326 | ) |
---|
| 327 | |
---|
| 328 | hq_matric_no2 = schema.TextLine( |
---|
| 329 | title = _(u'Former Matric Number'), |
---|
| 330 | required = False, |
---|
| 331 | readonly = False, |
---|
| 332 | ) |
---|
| 333 | |
---|
| 334 | hq_degree2 = schema.Choice( |
---|
| 335 | title = _(u'Class of Degree'), |
---|
| 336 | required = False, |
---|
| 337 | readonly = False, |
---|
| 338 | vocabulary = high_grade, |
---|
| 339 | ) |
---|
| 340 | |
---|
| 341 | hq_school2 = schema.TextLine( |
---|
| 342 | title = _(u'Institution Attended'), |
---|
| 343 | required = False, |
---|
| 344 | readonly = False, |
---|
| 345 | ) |
---|
| 346 | |
---|
| 347 | hq_session2 = schema.TextLine( |
---|
| 348 | title = _(u'Years Attended'), |
---|
| 349 | required = False, |
---|
| 350 | readonly = False, |
---|
| 351 | ) |
---|
| 352 | |
---|
| 353 | hq_disc2 = schema.TextLine( |
---|
| 354 | title = _(u'Discipline'), |
---|
| 355 | required = False, |
---|
| 356 | readonly = False, |
---|
| 357 | ) |
---|
| 358 | |
---|
| 359 | hq_type3 = schema.Choice( |
---|
| 360 | title = _(u'Qualification Obtained'), |
---|
| 361 | required = False, |
---|
| 362 | readonly = False, |
---|
| 363 | vocabulary = high_qual, |
---|
| 364 | ) |
---|
| 365 | |
---|
| 366 | hq_fname3 = schema.TextLine( |
---|
| 367 | title = _(u'Full Name'), |
---|
| 368 | required = False, |
---|
| 369 | readonly = False, |
---|
| 370 | ) |
---|
| 371 | |
---|
| 372 | hq_matric_no3 = schema.TextLine( |
---|
| 373 | title = _(u'Former Matric Number'), |
---|
| 374 | required = False, |
---|
| 375 | readonly = False, |
---|
| 376 | ) |
---|
| 377 | |
---|
| 378 | hq_degree3 = schema.Choice( |
---|
| 379 | title = _(u'Class of Degree'), |
---|
| 380 | required = False, |
---|
| 381 | readonly = False, |
---|
| 382 | vocabulary = high_grade, |
---|
| 383 | ) |
---|
| 384 | |
---|
| 385 | hq_school3 = schema.TextLine( |
---|
| 386 | title = _(u'Institution Attended'), |
---|
| 387 | required = False, |
---|
| 388 | readonly = False, |
---|
| 389 | ) |
---|
| 390 | |
---|
| 391 | hq_session3 = schema.TextLine( |
---|
| 392 | title = _(u'Years Attended'), |
---|
| 393 | required = False, |
---|
| 394 | readonly = False, |
---|
| 395 | ) |
---|
| 396 | |
---|
| 397 | hq_disc3 = schema.TextLine( |
---|
| 398 | title = _(u'Discipline'), |
---|
| 399 | required = False, |
---|
| 400 | readonly = False, |
---|
| 401 | ) |
---|
[13679] | 402 | |
---|
| 403 | nysc_year = schema.Int( |
---|
| 404 | title = _(u'Nysc Year'), |
---|
| 405 | required = False, |
---|
| 406 | readonly = False, |
---|
| 407 | ) |
---|
| 408 | |
---|
| 409 | nysc_location = schema.TextLine( |
---|
| 410 | title = _(u'Nysc Location'), |
---|
| 411 | required = False, |
---|
| 412 | ) |
---|
| 413 | |
---|
| 414 | nysc_lga = schema.Choice( |
---|
| 415 | source = LGASource(), |
---|
| 416 | title = _(u'Nysc LGA'), |
---|
| 417 | required = False, |
---|
| 418 | ) |
---|
| 419 | |
---|
| 420 | employer = schema.TextLine( |
---|
| 421 | title = _(u'Employer'), |
---|
| 422 | required = False, |
---|
| 423 | readonly = False, |
---|
| 424 | ) |
---|
| 425 | |
---|
| 426 | emp_position = schema.TextLine( |
---|
| 427 | title = _(u'Employer Position'), |
---|
| 428 | required = False, |
---|
| 429 | readonly = False, |
---|
| 430 | ) |
---|
| 431 | |
---|
| 432 | emp_start = FormattedDate( |
---|
| 433 | title = _(u'Start Date'), |
---|
| 434 | required = False, |
---|
| 435 | readonly = False, |
---|
| 436 | show_year = True, |
---|
| 437 | ) |
---|
| 438 | |
---|
| 439 | emp_end = FormattedDate( |
---|
| 440 | title = _(u'End Date'), |
---|
| 441 | required = False, |
---|
| 442 | readonly = False, |
---|
| 443 | show_year = True, |
---|
| 444 | ) |
---|
| 445 | |
---|
| 446 | emp_reason = schema.TextLine( |
---|
| 447 | title = _(u'Reason for Leaving'), |
---|
| 448 | required = False, |
---|
| 449 | readonly = False, |
---|
| 450 | ) |
---|
| 451 | |
---|
| 452 | employer2 = schema.TextLine( |
---|
| 453 | title = _(u'2nd Employer'), |
---|
| 454 | required = False, |
---|
| 455 | readonly = False, |
---|
| 456 | ) |
---|
| 457 | |
---|
| 458 | emp2_position = schema.TextLine( |
---|
| 459 | title = _(u'2nd Employer Position'), |
---|
| 460 | required = False, |
---|
| 461 | readonly = False, |
---|
| 462 | ) |
---|
| 463 | |
---|
| 464 | emp2_start = FormattedDate( |
---|
| 465 | title = _(u'Start Date'), |
---|
| 466 | required = False, |
---|
| 467 | readonly = False, |
---|
| 468 | show_year = True, |
---|
| 469 | ) |
---|
| 470 | |
---|
| 471 | emp2_end = FormattedDate( |
---|
| 472 | title = _(u'End Date'), |
---|
| 473 | required = False, |
---|
| 474 | readonly = False, |
---|
| 475 | show_year = True, |
---|
| 476 | ) |
---|
| 477 | |
---|
| 478 | emp2_reason = schema.TextLine( |
---|
| 479 | title = _(u'Reason for Leaving'), |
---|
| 480 | required = False, |
---|
| 481 | readonly = False, |
---|
| 482 | ) |
---|
| 483 | |
---|
| 484 | former_matric = schema.TextLine( |
---|
| 485 | title = _(u'If yes, matric number'), |
---|
| 486 | required = False, |
---|
| 487 | readonly = False, |
---|
| 488 | ) |
---|
| 489 | |
---|
[10298] | 490 | notice = schema.Text( |
---|
| 491 | title = _(u'Notice'), |
---|
| 492 | required = False, |
---|
| 493 | ) |
---|
[13977] | 494 | |
---|
| 495 | |
---|
| 496 | master_sheet_number = schema.TextLine( |
---|
| 497 | title = _(u'Master Sheet Number'), |
---|
| 498 | required = False, |
---|
| 499 | readonly = False, |
---|
| 500 | ) |
---|
| 501 | |
---|
[13996] | 502 | screening_venue = schema.TextLine( |
---|
| 503 | title = _(u'Screening Venue'), |
---|
| 504 | required = False, |
---|
| 505 | ) |
---|
[14666] | 506 | |
---|
[13996] | 507 | screening_date = schema.TextLine( |
---|
| 508 | title = _(u'Screening Date'), |
---|
| 509 | required = False, |
---|
| 510 | ) |
---|
[14666] | 511 | |
---|
[13996] | 512 | screening_score = schema.Int( |
---|
[14028] | 513 | title = _(u'Screening Points'), |
---|
[13996] | 514 | required = False, |
---|
| 515 | ) |
---|
[14666] | 516 | |
---|
[10298] | 517 | student_id = schema.TextLine( |
---|
| 518 | title = _(u'Student Id'), |
---|
| 519 | required = False, |
---|
| 520 | readonly = False, |
---|
| 521 | ) |
---|
[14666] | 522 | |
---|
[10298] | 523 | course_admitted = schema.Choice( |
---|
| 524 | title = _(u'Admitted Course of Study'), |
---|
| 525 | source = CertificateSource(), |
---|
| 526 | required = False, |
---|
| 527 | ) |
---|
[14666] | 528 | |
---|
[10298] | 529 | locked = schema.Bool( |
---|
| 530 | title = _(u'Form locked'), |
---|
| 531 | default = False, |
---|
| 532 | ) |
---|
| 533 | |
---|
| 534 | @invariant |
---|
[15455] | 535 | def course_choice(applicant): |
---|
[10298] | 536 | if applicant.course1 == applicant.course2: |
---|
| 537 | raise Invalid(_("2nd choice course must differ from 1st choice course.")) |
---|
[15455] | 538 | if applicant.course1 == applicant.course3: |
---|
| 539 | raise Invalid(_("3rd choice course must differ from 1st choice course.")) |
---|
| 540 | if applicant.course2 == applicant.course3: |
---|
| 541 | raise Invalid(_("3rd choice course must differ from 2nd choice course.")) |
---|
[10298] | 542 | |
---|
[13977] | 543 | #ICustomUGApplicant['programme_type'].order = IApplicantBaseData[ |
---|
| 544 | # 'reg_number'].order |
---|
[10924] | 545 | |
---|
[8931] | 546 | class ICustomPGApplicant(INigeriaPGApplicant): |
---|
[7853] | 547 | """A postgraduate applicant. |
---|
| 548 | |
---|
[8521] | 549 | This interface defines the least common multiple of all fields |
---|
| 550 | in pg application forms. In customized forms, fields can be excluded by |
---|
| 551 | adding them to the PG_OMIT* tuples. |
---|
[7866] | 552 | """ |
---|
| 553 | |
---|
[13544] | 554 | class ITranscriptApplicant(IKofaObject): |
---|
| 555 | """A transcript applicant. |
---|
| 556 | """ |
---|
[8012] | 557 | |
---|
[13544] | 558 | suspended = schema.Bool( |
---|
| 559 | title = _(u'Account suspended'), |
---|
| 560 | default = False, |
---|
| 561 | required = False, |
---|
| 562 | ) |
---|
| 563 | |
---|
| 564 | locked = schema.Bool( |
---|
| 565 | title = _(u'Form locked'), |
---|
| 566 | default = False, |
---|
| 567 | required = False, |
---|
| 568 | ) |
---|
| 569 | |
---|
| 570 | applicant_id = schema.TextLine( |
---|
[15951] | 571 | title = _(u'Application Id'), |
---|
[13544] | 572 | required = False, |
---|
| 573 | readonly = False, |
---|
| 574 | ) |
---|
| 575 | |
---|
[14472] | 576 | reg_number = TextLineChoice( |
---|
[14486] | 577 | title = _(u'Kofa Registration Number'), |
---|
[14472] | 578 | readonly = False, |
---|
| 579 | required = True, |
---|
| 580 | source = contextual_reg_num_source, |
---|
| 581 | ) |
---|
| 582 | |
---|
[13544] | 583 | firstname = schema.TextLine( |
---|
| 584 | title = _(u'First Name'), |
---|
| 585 | required = True, |
---|
| 586 | ) |
---|
| 587 | |
---|
| 588 | middlename = schema.TextLine( |
---|
| 589 | title = _(u'Middle Name'), |
---|
| 590 | required = False, |
---|
| 591 | ) |
---|
| 592 | |
---|
| 593 | lastname = schema.TextLine( |
---|
| 594 | title = _(u'Last Name (Surname)'), |
---|
| 595 | required = True, |
---|
| 596 | ) |
---|
| 597 | |
---|
[14472] | 598 | matric_number = schema.TextLine( |
---|
| 599 | title = _(u'Matriculation Number'), |
---|
[13544] | 600 | readonly = False, |
---|
[14486] | 601 | required = True, |
---|
[13544] | 602 | ) |
---|
| 603 | |
---|
| 604 | date_of_birth = FormattedDate( |
---|
| 605 | title = _(u'Date of Birth'), |
---|
[15275] | 606 | required = False, |
---|
[13544] | 607 | #date_format = u'%d/%m/%Y', # Use grok-instance-wide default |
---|
| 608 | show_year = True, |
---|
| 609 | ) |
---|
| 610 | |
---|
[15791] | 611 | sex = schema.Choice( |
---|
| 612 | title = _(u'Gender'), |
---|
| 613 | source = GenderSource(), |
---|
| 614 | required = True, |
---|
| 615 | ) |
---|
| 616 | |
---|
[13544] | 617 | place_of_birth = schema.TextLine( |
---|
| 618 | title = _(u'Place of Birth'), |
---|
| 619 | readonly = False, |
---|
[15275] | 620 | required = False, |
---|
[13544] | 621 | ) |
---|
| 622 | |
---|
| 623 | nationality = schema.Choice( |
---|
| 624 | vocabulary = nats_vocab, |
---|
| 625 | title = _(u'Nationality'), |
---|
[15275] | 626 | required = False, |
---|
[13544] | 627 | ) |
---|
| 628 | |
---|
| 629 | email = schema.ASCIILine( |
---|
| 630 | title = _(u'Email Address'), |
---|
| 631 | required = True, |
---|
| 632 | constraint=validate_email, |
---|
| 633 | ) |
---|
| 634 | |
---|
| 635 | phone = PhoneNumber( |
---|
| 636 | title = _(u'Phone'), |
---|
| 637 | description = u'', |
---|
[15275] | 638 | required = False, |
---|
[13544] | 639 | ) |
---|
| 640 | |
---|
| 641 | perm_address = schema.Text( |
---|
| 642 | title = _(u'Current Local Address'), |
---|
[15275] | 643 | required = False, |
---|
[13544] | 644 | readonly = False, |
---|
| 645 | ) |
---|
| 646 | |
---|
| 647 | dispatch_address = schema.Text( |
---|
[14306] | 648 | title = _(u'Dispatch Addresses'), |
---|
| 649 | description = u'Addresses to which transcript should be posted.', |
---|
[15275] | 650 | required = False, |
---|
[13544] | 651 | readonly = False, |
---|
| 652 | ) |
---|
| 653 | |
---|
| 654 | entry_mode = schema.Choice( |
---|
| 655 | title = _(u'Entry Mode'), |
---|
| 656 | source = StudyModeSource(), |
---|
[15275] | 657 | required = False, |
---|
[13544] | 658 | readonly = False, |
---|
| 659 | ) |
---|
| 660 | |
---|
| 661 | entry_session = schema.Choice( |
---|
| 662 | title = _(u'Entry Session'), |
---|
| 663 | source = academic_sessions_vocab, |
---|
[15275] | 664 | required = False, |
---|
[13544] | 665 | readonly = False, |
---|
| 666 | ) |
---|
| 667 | |
---|
| 668 | end_session = schema.Choice( |
---|
| 669 | title = _(u'End Session'), |
---|
| 670 | source = academic_sessions_vocab, |
---|
[15275] | 671 | required = False, |
---|
[13544] | 672 | readonly = False, |
---|
| 673 | ) |
---|
| 674 | |
---|
| 675 | course_studied = schema.Choice( |
---|
| 676 | title = _(u'Course of Study / Degree'), |
---|
| 677 | source = CertificateSource(), |
---|
[15275] | 678 | required = False, |
---|
[13544] | 679 | readonly = False, |
---|
| 680 | ) |
---|
| 681 | |
---|
| 682 | purpose = schema.TextLine( |
---|
| 683 | title = _(u'Purpose of this Application'), |
---|
| 684 | readonly = False, |
---|
| 685 | required = False, |
---|
| 686 | ) |
---|
| 687 | |
---|
| 688 | course_changed = schema.Choice( |
---|
| 689 | title = _(u'Change of Study Course'), |
---|
| 690 | description = u'If yes, select previous course of study.', |
---|
| 691 | source = CertificateSource(), |
---|
| 692 | readonly = False, |
---|
| 693 | required = False, |
---|
| 694 | ) |
---|
| 695 | |
---|
| 696 | change_level = schema.Choice( |
---|
| 697 | title = _(u'Change Level'), |
---|
| 698 | description = u'If yes, select level at which you changed course of study.', |
---|
| 699 | source = StudyLevelSource(), |
---|
| 700 | required = False, |
---|
| 701 | readonly = False, |
---|
| 702 | ) |
---|
| 703 | |
---|
[14306] | 704 | no_copies = schema.Choice( |
---|
| 705 | title = _(u'Number of Copies'), |
---|
| 706 | description = u'Must correspond with the number of dispatch addresses above.', |
---|
| 707 | values=[1, 2, 3, 4], |
---|
| 708 | required = False, |
---|
| 709 | readonly = False, |
---|
| 710 | default = 1, |
---|
| 711 | ) |
---|
| 712 | |
---|
[14304] | 713 | class ICertificateRequest(IKofaObject): |
---|
| 714 | """A transcript applicant. |
---|
| 715 | """ |
---|
[13544] | 716 | |
---|
[14304] | 717 | suspended = schema.Bool( |
---|
| 718 | title = _(u'Account suspended'), |
---|
| 719 | default = False, |
---|
| 720 | required = False, |
---|
| 721 | ) |
---|
| 722 | |
---|
| 723 | locked = schema.Bool( |
---|
| 724 | title = _(u'Form locked'), |
---|
| 725 | default = False, |
---|
| 726 | required = False, |
---|
| 727 | ) |
---|
| 728 | |
---|
| 729 | applicant_id = schema.TextLine( |
---|
[15951] | 730 | title = _(u'Application Id'), |
---|
[14304] | 731 | required = False, |
---|
| 732 | readonly = False, |
---|
| 733 | ) |
---|
| 734 | |
---|
[14472] | 735 | reg_number = TextLineChoice( |
---|
[14486] | 736 | title = _(u'Kofa Registration Number'), |
---|
[14472] | 737 | readonly = False, |
---|
| 738 | required = True, |
---|
| 739 | source = contextual_reg_num_source, |
---|
| 740 | ) |
---|
| 741 | |
---|
[14304] | 742 | firstname = schema.TextLine( |
---|
| 743 | title = _(u'First Name'), |
---|
| 744 | required = True, |
---|
| 745 | ) |
---|
| 746 | |
---|
| 747 | middlename = schema.TextLine( |
---|
| 748 | title = _(u'Middle Name'), |
---|
| 749 | required = False, |
---|
| 750 | ) |
---|
| 751 | |
---|
| 752 | lastname = schema.TextLine( |
---|
| 753 | title = _(u'Last Name (Surname)'), |
---|
| 754 | required = True, |
---|
| 755 | ) |
---|
| 756 | |
---|
[14472] | 757 | matric_number = schema.TextLine( |
---|
| 758 | title = _(u'Matriculation Number'), |
---|
[14304] | 759 | readonly = False, |
---|
[14486] | 760 | required = True, |
---|
[14304] | 761 | ) |
---|
| 762 | |
---|
| 763 | date_of_birth = FormattedDate( |
---|
| 764 | title = _(u'Date of Birth'), |
---|
[15275] | 765 | required = False, |
---|
[14304] | 766 | #date_format = u'%d/%m/%Y', # Use grok-instance-wide default |
---|
| 767 | show_year = True, |
---|
| 768 | ) |
---|
| 769 | |
---|
[15791] | 770 | sex = schema.Choice( |
---|
| 771 | title = _(u'Gender'), |
---|
| 772 | source = GenderSource(), |
---|
| 773 | required = True, |
---|
| 774 | ) |
---|
| 775 | |
---|
[14304] | 776 | place_of_birth = schema.TextLine( |
---|
| 777 | title = _(u'Place of Birth'), |
---|
| 778 | readonly = False, |
---|
[15275] | 779 | required = False, |
---|
[14304] | 780 | ) |
---|
| 781 | |
---|
| 782 | nationality = schema.Choice( |
---|
| 783 | vocabulary = nats_vocab, |
---|
| 784 | title = _(u'Nationality'), |
---|
[15275] | 785 | required = False, |
---|
[14304] | 786 | ) |
---|
| 787 | |
---|
| 788 | email = schema.ASCIILine( |
---|
| 789 | title = _(u'Email Address'), |
---|
| 790 | required = True, |
---|
| 791 | constraint=validate_email, |
---|
| 792 | ) |
---|
| 793 | |
---|
| 794 | phone = PhoneNumber( |
---|
| 795 | title = _(u'Phone'), |
---|
| 796 | description = u'', |
---|
[15275] | 797 | required = False, |
---|
[14304] | 798 | ) |
---|
| 799 | |
---|
| 800 | entry_session = schema.Choice( |
---|
| 801 | title = _(u'Entry Session'), |
---|
| 802 | source = academic_sessions_vocab, |
---|
[15275] | 803 | required = False, |
---|
[14304] | 804 | readonly = False, |
---|
| 805 | ) |
---|
| 806 | |
---|
| 807 | end_session = schema.Choice( |
---|
| 808 | title = _(u'End Session'), |
---|
| 809 | source = academic_sessions_vocab, |
---|
[15275] | 810 | required = False, |
---|
[14304] | 811 | readonly = False, |
---|
| 812 | ) |
---|
| 813 | |
---|
| 814 | course_studied = schema.Choice( |
---|
| 815 | title = _(u'Course of Study / Degree'), |
---|
| 816 | source = CertificateSource(), |
---|
[14486] | 817 | required = True, |
---|
[14304] | 818 | readonly = False, |
---|
| 819 | ) |
---|
| 820 | |
---|
[15118] | 821 | certificate_type = schema.Choice( |
---|
| 822 | title = _(u'Certificate Type'), |
---|
| 823 | vocabulary = certificate_types_vocab, |
---|
[15275] | 824 | required = False, |
---|
[15118] | 825 | ) |
---|
[14306] | 826 | |
---|
[15118] | 827 | |
---|
[15530] | 828 | class IVerificationRequest(IKofaObject): |
---|
| 829 | """A applicant asking for verification. |
---|
| 830 | """ |
---|
| 831 | |
---|
| 832 | suspended = schema.Bool( |
---|
| 833 | title = _(u'Account suspended'), |
---|
| 834 | default = False, |
---|
| 835 | required = False, |
---|
| 836 | ) |
---|
| 837 | |
---|
| 838 | locked = schema.Bool( |
---|
| 839 | title = _(u'Form locked'), |
---|
| 840 | default = False, |
---|
| 841 | required = False, |
---|
| 842 | ) |
---|
| 843 | |
---|
| 844 | applicant_id = schema.TextLine( |
---|
[15951] | 845 | title = _(u'Application Id'), |
---|
[15530] | 846 | required = False, |
---|
| 847 | readonly = False, |
---|
| 848 | ) |
---|
| 849 | |
---|
| 850 | #reg_number = TextLineChoice( |
---|
| 851 | # title = _(u'Kofa Registration Number'), |
---|
| 852 | # readonly = False, |
---|
| 853 | # required = True, |
---|
| 854 | # source = contextual_reg_num_source, |
---|
| 855 | # ) |
---|
| 856 | |
---|
| 857 | firstname = schema.TextLine( |
---|
| 858 | title = _(u'First Name'), |
---|
| 859 | required = True, |
---|
| 860 | ) |
---|
| 861 | |
---|
| 862 | middlename = schema.TextLine( |
---|
| 863 | title = _(u'Middle Name'), |
---|
| 864 | required = False, |
---|
| 865 | ) |
---|
| 866 | |
---|
| 867 | lastname = schema.TextLine( |
---|
| 868 | title = _(u'Last Name (Surname)'), |
---|
| 869 | required = True, |
---|
| 870 | ) |
---|
| 871 | |
---|
[15791] | 872 | sex = schema.Choice( |
---|
| 873 | title = _(u'Gender'), |
---|
| 874 | source = GenderSource(), |
---|
| 875 | required = True, |
---|
| 876 | ) |
---|
| 877 | |
---|
[15530] | 878 | email = schema.ASCIILine( |
---|
| 879 | title = _(u'Email Address'), |
---|
| 880 | required = True, |
---|
| 881 | constraint=validate_email, |
---|
| 882 | ) |
---|
| 883 | |
---|
[15861] | 884 | phone = PhoneNumber( |
---|
| 885 | title = _(u'Phone'), |
---|
| 886 | description = u'', |
---|
| 887 | required = False, |
---|
| 888 | ) |
---|
| 889 | |
---|
[15530] | 890 | matric_number = schema.TextLine( |
---|
| 891 | title = _(u'Verification Body Reference Number'), |
---|
| 892 | readonly = False, |
---|
| 893 | required = True, |
---|
| 894 | ) |
---|
| 895 | |
---|
| 896 | body_address = schema.Text( |
---|
| 897 | title = _(u'Verification Body Address'), |
---|
| 898 | required = True, |
---|
| 899 | ) |
---|
| 900 | |
---|
| 901 | document_type = schema.Choice( |
---|
| 902 | title = _(u'Document Type'), |
---|
| 903 | vocabulary = document_types_vocab, |
---|
| 904 | required = True, |
---|
| 905 | ) |
---|
| 906 | |
---|
[15950] | 907 | class IFedexRequest(IKofaObject): |
---|
| 908 | """A applicant requests payment for courier. |
---|
| 909 | """ |
---|
| 910 | |
---|
| 911 | suspended = schema.Bool( |
---|
| 912 | title = _(u'Account suspended'), |
---|
| 913 | default = False, |
---|
| 914 | required = False, |
---|
| 915 | ) |
---|
| 916 | |
---|
| 917 | locked = schema.Bool( |
---|
| 918 | title = _(u'Form locked'), |
---|
| 919 | default = False, |
---|
| 920 | required = False, |
---|
| 921 | ) |
---|
| 922 | |
---|
| 923 | applicant_id = schema.TextLine( |
---|
[15951] | 924 | title = _(u'Application Id'), |
---|
[15950] | 925 | required = False, |
---|
| 926 | readonly = False, |
---|
| 927 | ) |
---|
| 928 | |
---|
[15951] | 929 | trans_id = schema.TextLine( |
---|
[15954] | 930 | title = _(u'Transcript Application Id'), |
---|
[15951] | 931 | required = True, |
---|
| 932 | readonly = False, |
---|
[16005] | 933 | #description = u'This serve as a unique identifier which ' |
---|
| 934 | # 'allows the the officer to verify the transcript ' |
---|
| 935 | # 'in order to avoid errors before dispatch.', |
---|
[15951] | 936 | ) |
---|
| 937 | |
---|
[15950] | 938 | #reg_number = TextLineChoice( |
---|
| 939 | # title = _(u'Kofa Registration Number'), |
---|
| 940 | # readonly = False, |
---|
| 941 | # required = True, |
---|
| 942 | # source = contextual_reg_num_source, |
---|
| 943 | # ) |
---|
| 944 | |
---|
| 945 | firstname = schema.TextLine( |
---|
| 946 | title = _(u'First Name'), |
---|
| 947 | required = True, |
---|
| 948 | ) |
---|
| 949 | |
---|
| 950 | middlename = schema.TextLine( |
---|
| 951 | title = _(u'Middle Name'), |
---|
| 952 | required = False, |
---|
| 953 | ) |
---|
| 954 | |
---|
| 955 | lastname = schema.TextLine( |
---|
| 956 | title = _(u'Last Name (Surname)'), |
---|
| 957 | required = True, |
---|
| 958 | ) |
---|
| 959 | |
---|
| 960 | sex = schema.Choice( |
---|
| 961 | title = _(u'Gender'), |
---|
| 962 | source = GenderSource(), |
---|
| 963 | required = True, |
---|
| 964 | ) |
---|
| 965 | |
---|
| 966 | email = schema.ASCIILine( |
---|
| 967 | title = _(u'Email Address'), |
---|
| 968 | required = True, |
---|
| 969 | constraint=validate_email, |
---|
| 970 | ) |
---|
| 971 | |
---|
| 972 | phone = PhoneNumber( |
---|
| 973 | title = _(u'Phone'), |
---|
| 974 | description = u'', |
---|
| 975 | required = False, |
---|
| 976 | ) |
---|
| 977 | |
---|
| 978 | matric_number = schema.TextLine( |
---|
| 979 | title = _(u'WES Reference Number (where applicable)'), |
---|
| 980 | readonly = False, |
---|
| 981 | required = False, |
---|
| 982 | ) |
---|
| 983 | |
---|
| 984 | dispatch_address = schema.Text( |
---|
| 985 | title = _(u'Dispatch Address'), |
---|
| 986 | required = True, |
---|
| 987 | ) |
---|
| 988 | |
---|
[15991] | 989 | class IRecruitment(IKofaObject): |
---|
| 990 | """A recruitment application. |
---|
| 991 | """ |
---|
| 992 | |
---|
| 993 | suspended = schema.Bool( |
---|
| 994 | title = _(u'Account suspended'), |
---|
| 995 | default = False, |
---|
| 996 | required = False, |
---|
| 997 | ) |
---|
| 998 | |
---|
| 999 | locked = schema.Bool( |
---|
| 1000 | title = _(u'Form locked'), |
---|
| 1001 | default = False, |
---|
| 1002 | required = False, |
---|
| 1003 | ) |
---|
| 1004 | |
---|
| 1005 | applicant_id = schema.TextLine( |
---|
| 1006 | title = _(u'Application Id'), |
---|
| 1007 | required = False, |
---|
| 1008 | readonly = False, |
---|
| 1009 | ) |
---|
| 1010 | |
---|
| 1011 | #reg_number = TextLineChoice( |
---|
| 1012 | # title = _(u'Kofa Registration Number'), |
---|
| 1013 | # readonly = False, |
---|
| 1014 | # required = True, |
---|
| 1015 | # source = contextual_reg_num_source, |
---|
| 1016 | # ) |
---|
| 1017 | |
---|
| 1018 | application_types = schema.Choice( |
---|
| 1019 | title = _(u'Application Category'), |
---|
| 1020 | vocabulary = application_types_vocab, |
---|
| 1021 | required = True, |
---|
| 1022 | ) |
---|
| 1023 | |
---|
[15994] | 1024 | position_comment = schema.Text( |
---|
| 1025 | title = _(u'Desired Position'), |
---|
| 1026 | required = True, |
---|
| 1027 | description = u'Copy and paste the vacant position ' |
---|
| 1028 | 'text from the <a target="_blank" ' |
---|
| 1029 | 'href="https://aauekpoma.edu.ng/">university website</a>.', |
---|
| 1030 | ) |
---|
| 1031 | |
---|
[15991] | 1032 | firstname = schema.TextLine( |
---|
| 1033 | title = _(u'First Name'), |
---|
| 1034 | required = True, |
---|
| 1035 | ) |
---|
| 1036 | |
---|
| 1037 | middlename = schema.TextLine( |
---|
| 1038 | title = _(u'Middle Name'), |
---|
| 1039 | required = False, |
---|
| 1040 | ) |
---|
| 1041 | |
---|
| 1042 | lastname = schema.TextLine( |
---|
| 1043 | title = _(u'Last Name (Surname)'), |
---|
| 1044 | required = True, |
---|
| 1045 | ) |
---|
| 1046 | |
---|
| 1047 | sex = schema.Choice( |
---|
| 1048 | title = _(u'Gender'), |
---|
| 1049 | source = GenderSource(), |
---|
| 1050 | required = True, |
---|
| 1051 | ) |
---|
| 1052 | |
---|
| 1053 | email = schema.ASCIILine( |
---|
| 1054 | title = _(u'Email Address'), |
---|
| 1055 | required = True, |
---|
| 1056 | constraint=validate_email, |
---|
| 1057 | ) |
---|
| 1058 | |
---|
| 1059 | phone = PhoneNumber( |
---|
| 1060 | title = _(u'Phone'), |
---|
| 1061 | description = u'', |
---|
| 1062 | required = False, |
---|
| 1063 | ) |
---|
| 1064 | |
---|
| 1065 | address = schema.Text( |
---|
| 1066 | title = _(u'Address'), |
---|
| 1067 | required = True, |
---|
| 1068 | ) |
---|
| 1069 | |
---|
[15531] | 1070 | class ISendByEmailRequest(IKofaObject): |
---|
| 1071 | """A applicant asking for sending an email. |
---|
| 1072 | """ |
---|
[15530] | 1073 | |
---|
[15531] | 1074 | suspended = schema.Bool( |
---|
| 1075 | title = _(u'Account suspended'), |
---|
| 1076 | default = False, |
---|
| 1077 | required = False, |
---|
| 1078 | ) |
---|
| 1079 | |
---|
| 1080 | locked = schema.Bool( |
---|
| 1081 | title = _(u'Form locked'), |
---|
| 1082 | default = False, |
---|
| 1083 | required = False, |
---|
| 1084 | ) |
---|
| 1085 | |
---|
| 1086 | applicant_id = schema.TextLine( |
---|
| 1087 | title = _(u'Applicant Id'), |
---|
| 1088 | required = False, |
---|
| 1089 | readonly = False, |
---|
| 1090 | ) |
---|
| 1091 | |
---|
| 1092 | firstname = schema.TextLine( |
---|
| 1093 | title = _(u'First Name'), |
---|
| 1094 | required = True, |
---|
| 1095 | ) |
---|
| 1096 | |
---|
| 1097 | middlename = schema.TextLine( |
---|
| 1098 | title = _(u'Middle Name'), |
---|
| 1099 | required = False, |
---|
| 1100 | ) |
---|
| 1101 | |
---|
| 1102 | lastname = schema.TextLine( |
---|
| 1103 | title = _(u'Last Name (Surname)'), |
---|
| 1104 | required = True, |
---|
| 1105 | ) |
---|
| 1106 | |
---|
[15791] | 1107 | sex = schema.Choice( |
---|
| 1108 | title = _(u'Gender'), |
---|
| 1109 | source = GenderSource(), |
---|
| 1110 | required = True, |
---|
| 1111 | ) |
---|
| 1112 | |
---|
[15531] | 1113 | email = schema.ASCIILine( |
---|
| 1114 | title = _(u"Applicant's Email Address"), |
---|
| 1115 | required = True, |
---|
| 1116 | constraint=validate_email, |
---|
| 1117 | ) |
---|
| 1118 | |
---|
[15861] | 1119 | phone = PhoneNumber( |
---|
| 1120 | title = _(u'Phone'), |
---|
| 1121 | description = u'', |
---|
| 1122 | required = False, |
---|
| 1123 | ) |
---|
| 1124 | |
---|
[15531] | 1125 | body_address = schema.Text( |
---|
| 1126 | title = _(u'Address of Requesting Organization'), |
---|
| 1127 | required = True, |
---|
| 1128 | ) |
---|
| 1129 | |
---|
| 1130 | body_email = schema.ASCIILine( |
---|
| 1131 | title = _(u"Email Address of Requesting Organization"), |
---|
| 1132 | required = True, |
---|
| 1133 | constraint=validate_email, |
---|
| 1134 | ) |
---|
| 1135 | |
---|
[15740] | 1136 | request_type = schema.Choice( |
---|
| 1137 | title = _(u'Request Type'), |
---|
| 1138 | vocabulary = request_types_vocab, |
---|
| 1139 | required = True, |
---|
| 1140 | ) |
---|
| 1141 | |
---|
[15693] | 1142 | document_type = schema.Choice( |
---|
| 1143 | title = _(u'Document Type'), |
---|
| 1144 | vocabulary = document_types_vocab, |
---|
| 1145 | required = True, |
---|
| 1146 | ) |
---|
| 1147 | |
---|
[13544] | 1148 | class ICustomApplicant(ICustomUGApplicant, ICustomPGApplicant, |
---|
[15530] | 1149 | ITranscriptApplicant, ICertificateRequest, |
---|
[15951] | 1150 | IVerificationRequest, ISendByEmailRequest, |
---|
[15991] | 1151 | IFedexRequest, IRecruitment): |
---|
[14471] | 1152 | """An interface for all types of applicants. |
---|
[13544] | 1153 | |
---|
[8931] | 1154 | Attention: The ICustomPGApplicant field seetings will be overwritten |
---|
| 1155 | by ICustomPGApplicant field settings. If a field is defined |
---|
[8728] | 1156 | in both interfaces zope.schema validates only against the |
---|
[8931] | 1157 | constraints in ICustomUGApplicant. This does not affect the forms |
---|
| 1158 | since they are build on either ICustomUGApplicant or ICustomPGApplicant. |
---|
[8012] | 1159 | """ |
---|
| 1160 | |
---|
[8746] | 1161 | def writeLogMessage(view, comment): |
---|
[8053] | 1162 | """Adds an INFO message to the log file |
---|
| 1163 | """ |
---|
| 1164 | |
---|
| 1165 | def createStudent(): |
---|
| 1166 | """Create a student object from applicatnt data |
---|
| 1167 | and copy applicant object. |
---|
| 1168 | """ |
---|
| 1169 | |
---|
[10298] | 1170 | class ICustomUGApplicantEdit(ICustomUGApplicant): |
---|
[8728] | 1171 | """An undergraduate applicant interface for edit forms. |
---|
[8012] | 1172 | |
---|
| 1173 | Here we can repeat the fields from base data and set the |
---|
| 1174 | `required` and `readonly` attributes to True to further restrict |
---|
| 1175 | the data access. Or we can allow only certain certificates to be |
---|
| 1176 | selected by choosing the appropriate source. |
---|
| 1177 | |
---|
| 1178 | We cannot omit fields here. This has to be done in the |
---|
| 1179 | respective form page. |
---|
| 1180 | """ |
---|
| 1181 | |
---|
[13977] | 1182 | #programme_type = schema.Choice( |
---|
| 1183 | # title = _(u'Programme Type'), |
---|
| 1184 | # vocabulary = programme_types_vocab, |
---|
| 1185 | # required = True, |
---|
| 1186 | # ) |
---|
[13548] | 1187 | |
---|
[10924] | 1188 | date_of_birth = FormattedDate( |
---|
| 1189 | title = _(u'Date of Birth'), |
---|
| 1190 | required = True, |
---|
| 1191 | show_year = True, |
---|
| 1192 | ) |
---|
| 1193 | |
---|
[15462] | 1194 | course1 = schema.Choice( |
---|
| 1195 | title = _(u'1st Choice Course of Study'), |
---|
| 1196 | source = AppCatCertificateSource(), |
---|
| 1197 | required = True, |
---|
| 1198 | ) |
---|
| 1199 | |
---|
| 1200 | course2 = schema.Choice( |
---|
| 1201 | title = _(u'2nd Choice Course of Study'), |
---|
| 1202 | source = AppCatCertificateSource(), |
---|
| 1203 | required = True, |
---|
| 1204 | ) |
---|
| 1205 | |
---|
| 1206 | course3 = schema.Choice( |
---|
| 1207 | title = _(u'3rd Choice Course of Study'), |
---|
| 1208 | source = AppCatCertificateSource(), |
---|
| 1209 | required = True, |
---|
| 1210 | ) |
---|
| 1211 | |
---|
[14829] | 1212 | fst_sit_fname = schema.TextLine( |
---|
| 1213 | title = _(u'Full Name'), |
---|
| 1214 | required = True, |
---|
| 1215 | readonly = False, |
---|
| 1216 | ) |
---|
| 1217 | |
---|
| 1218 | fst_sit_no = schema.TextLine( |
---|
| 1219 | title = _(u'Exam Number'), |
---|
| 1220 | required = True, |
---|
| 1221 | readonly = False, |
---|
| 1222 | ) |
---|
| 1223 | |
---|
| 1224 | fst_sit_sc_pin = schema.TextLine( |
---|
| 1225 | title = _(u'Scratch Card Pin'), |
---|
| 1226 | required = True, |
---|
| 1227 | readonly = False, |
---|
| 1228 | ) |
---|
| 1229 | |
---|
| 1230 | fst_sit_sc_serial_number = schema.TextLine( |
---|
| 1231 | title = _(u'Scratch Card Serial Number'), |
---|
| 1232 | required = True, |
---|
| 1233 | readonly = False, |
---|
| 1234 | ) |
---|
| 1235 | |
---|
| 1236 | fst_sit_date = FormattedDate( |
---|
| 1237 | title = _(u'Exam Date'), |
---|
| 1238 | required = True, |
---|
| 1239 | readonly = False, |
---|
| 1240 | show_year = True, |
---|
| 1241 | ) |
---|
| 1242 | |
---|
| 1243 | fst_sit_type = schema.Choice( |
---|
| 1244 | title = _(u'Exam Type'), |
---|
| 1245 | required = True, |
---|
| 1246 | readonly = False, |
---|
| 1247 | vocabulary = exam_types, |
---|
| 1248 | ) |
---|
| 1249 | |
---|
[15459] | 1250 | # course1 works only on manage pages. On edit pages course1 input is missing |
---|
| 1251 | # and no Invalid exception is raised. |
---|
| 1252 | # NoInputData: NoInputD...course1' |
---|
| 1253 | # Therefore, we check and compare course1 on CustomApplicantEditFormPage. |
---|
| 1254 | @invariant |
---|
| 1255 | def course_choice(applicant): |
---|
| 1256 | if applicant.course2 == applicant.course3: |
---|
| 1257 | raise Invalid(_("3rd choice course must differ from 2nd choice course.")) |
---|
| 1258 | |
---|
[13977] | 1259 | #ICustomUGApplicantEdit['programme_type'].order = ICustomUGApplicant[ |
---|
| 1260 | # 'programme_type'].order |
---|
[10924] | 1261 | ICustomUGApplicantEdit['date_of_birth'].order = ICustomUGApplicant[ |
---|
| 1262 | 'date_of_birth'].order |
---|
[15462] | 1263 | ICustomUGApplicantEdit['course1'].order = ICustomUGApplicant[ |
---|
| 1264 | 'course1'].order |
---|
| 1265 | ICustomUGApplicantEdit['course2'].order = ICustomUGApplicant[ |
---|
| 1266 | 'course2'].order |
---|
| 1267 | ICustomUGApplicantEdit['course3'].order = ICustomUGApplicant[ |
---|
| 1268 | 'course3'].order |
---|
[14829] | 1269 | ICustomUGApplicantEdit['fst_sit_fname'].order = ICustomUGApplicant[ |
---|
| 1270 | 'fst_sit_fname'].order |
---|
| 1271 | ICustomUGApplicantEdit['fst_sit_no'].order = ICustomUGApplicant[ |
---|
| 1272 | 'fst_sit_no'].order |
---|
| 1273 | ICustomUGApplicantEdit['fst_sit_sc_pin'].order = ICustomUGApplicant[ |
---|
| 1274 | 'fst_sit_sc_pin'].order |
---|
| 1275 | ICustomUGApplicantEdit['fst_sit_sc_serial_number'].order = ICustomUGApplicant[ |
---|
| 1276 | 'fst_sit_sc_serial_number'].order |
---|
| 1277 | ICustomUGApplicantEdit['fst_sit_date'].order = ICustomUGApplicant[ |
---|
| 1278 | 'fst_sit_date'].order |
---|
| 1279 | ICustomUGApplicantEdit['fst_sit_type'].order = ICustomUGApplicant[ |
---|
| 1280 | 'fst_sit_type'].order |
---|
[10924] | 1281 | |
---|
[8980] | 1282 | class ICustomPGApplicantEdit(INigeriaPGApplicantEdit): |
---|
[7866] | 1283 | """A postgraduate applicant interface for editing. |
---|
| 1284 | |
---|
| 1285 | Here we can repeat the fields from base data and set the |
---|
| 1286 | `required` and `readonly` attributes to True to further restrict |
---|
| 1287 | the data access. Or we can allow only certain certificates to be |
---|
| 1288 | selected by choosing the appropriate source. |
---|
| 1289 | |
---|
| 1290 | We cannot omit fields here. This has to be done in the |
---|
| 1291 | respective form page. |
---|
[8017] | 1292 | """ |
---|
[8455] | 1293 | |
---|
[8931] | 1294 | class ICustomApplicantOnlinePayment(INigeriaApplicantOnlinePayment): |
---|
[8247] | 1295 | """An applicant payment via payment gateways. |
---|
| 1296 | |
---|
| 1297 | """ |
---|
[8532] | 1298 | |
---|
[8980] | 1299 | class IPUTMEApplicantEdit(IPUTMEApplicantEdit): |
---|
[8532] | 1300 | """An undergraduate applicant interface for editing. |
---|
| 1301 | |
---|
| 1302 | Here we can repeat the fields from base data and set the |
---|
| 1303 | `required` and `readonly` attributes to True to further restrict |
---|
| 1304 | the data access. Or we can allow only certain certificates to be |
---|
| 1305 | selected by choosing the appropriate source. |
---|
| 1306 | |
---|
| 1307 | We cannot omit fields here. This has to be done in the |
---|
| 1308 | respective form page. |
---|
| 1309 | """ |
---|
| 1310 | |
---|
[14471] | 1311 | class ICustomApplicantUpdateByRegNo(ICustomApplicant): |
---|
[8583] | 1312 | """Representation of an applicant. |
---|
| 1313 | |
---|
| 1314 | Skip regular reg_number validation if reg_number is used for finding |
---|
| 1315 | the applicant object. |
---|
| 1316 | """ |
---|
[8980] | 1317 | |
---|
[14471] | 1318 | reg_number = schema.TextLine( |
---|
| 1319 | title = u'Registration Number', |
---|
| 1320 | required = False, |
---|
| 1321 | ) |
---|
[13544] | 1322 | |
---|
| 1323 | |
---|
[14471] | 1324 | |
---|
| 1325 | |
---|