Changeset 16804 for main/waeup.uniben/trunk
- Timestamp:
- 14 Feb 2022, 07:13:51 (3 years ago)
- Location:
- main/waeup.uniben/trunk/src/waeup/uniben/applicants
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.uniben/trunk/src/waeup/uniben/applicants/browser.py
r16766 r16804 53 53 ICustomUGApplicantEdit, 54 54 IPUTMEApplicantEdit, 55 ITranscriptApplicant) 55 ITranscriptApplicant, 56 IFrenchApplicant) 56 57 from waeup.kofa.applicants.workflow import ADMITTED, PAID, STARTED 57 58 from kofacustom.nigeria.applicants.interfaces import ( … … 257 258 #form_fields['perm_address'].custom_widget = BytesDisplayWidget 258 259 return form_fields 260 if self.target is not None and self.target == 'french': 261 form_fields = grok.AutoFields(IFrenchApplicant) 262 for field in REGISTRATION_OMIT_DISPLAY_FIELDS: 263 form_fields = form_fields.omit(field) 264 return form_fields 259 265 if self.target == 'ictwk': 260 266 form_fields = grok.AutoFields(IUnibenRegistration) … … 452 458 form_fields['registration_cats'].for_display = True 453 459 return form_fields 460 if self.target is not None and self.target == 'french': 461 form_fields = grok.AutoFields(IFrenchApplicant) 462 for field in REGISTRATION_OMIT_MANAGE_FIELDS: 463 form_fields = form_fields.omit(field) 464 return form_fields 454 465 if self.target is not None and self.target.startswith('pg'): 455 466 form_fields = grok.AutoFields(ICustomPGApplicant) … … 511 522 for field in TRANS_OMIT_EDIT_FIELDS: 512 523 form_fields = form_fields.omit(field) 513 form_fields = form_fields.omit('locked')514 524 if state == PAID: 515 525 form_fields['order'].for_display = True 526 form_fields = form_fields.omit('locked') 516 527 return form_fields 517 528 if self.target is not None and self.target == 'tscs': … … 521 532 for field in TRANS_SHORT_OMIT_EDIT_FIELDS: 522 533 form_fields = form_fields.omit(field) 523 534 form_fields = form_fields.omit('locked') 524 535 if state == PAID: 525 536 form_fields['order'].for_display = True … … 531 542 if state != STARTED: 532 543 form_fields['registration_cats'].for_display = True 544 return form_fields 545 if self.target is not None and self.target == 'french': 546 form_fields = grok.AutoFields(IFrenchApplicant) 547 for field in REGISTRATION_OMIT_EDIT_FIELDS: 548 form_fields = form_fields.omit(field) 533 549 return form_fields 534 550 if self.target is not None and self.target.startswith('pg'): … … 705 721 for field in PUDE_OMIT_PDF_FIELDS: 706 722 form_fields = form_fields.omit(field) 723 elif self.target is not None and self.target == 'french': 724 form_fields = grok.AutoFields(IFrenchApplicant) 725 for field in REGISTRATION_OMIT_PDF_FIELDS: 726 form_fields = form_fields.omit(field) 707 727 else: 708 728 form_fields = grok.AutoFields(ICustomUGApplicant) -
main/waeup.uniben/trunk/src/waeup/uniben/applicants/interfaces.py
r16775 r16804 142 142 return _('Certified True Copy') 143 143 144 class ProficiencySource(BasicSourceFactory): 145 """ 146 """ 147 def getValues(self): 148 return ['n', 'c', 'p'] 149 150 def getToken(self, value): 151 return value 152 153 def getTitle(self, value): 154 if value == 'n': 155 return _('none') 156 if value == 'c': 157 return _('conversational') 158 if value == 'c': 159 return _('professional') 160 144 161 class IUnibenRegistration(IKofaObject): 145 162 """A Uniben registrant. … … 444 461 raise Invalid(_("You've selected the wrong transcript charge.")) 445 462 463 class IFrenchApplicant(IKofaObject): 464 """A transcript applicant. 465 """ 466 467 suspended = schema.Bool( 468 title = _(u'Account suspended'), 469 default = False, 470 required = False, 471 ) 472 473 locked = schema.Bool( 474 title = _(u'Form locked'), 475 default = False, 476 required = False, 477 ) 478 479 applicant_id = schema.TextLine( 480 title = _(u'Applicant Id'), 481 required = False, 482 readonly = False, 483 ) 484 485 firstname = schema.TextLine( 486 title = _(u'First Name'), 487 required = True, 488 ) 489 490 middlename = schema.TextLine( 491 title = _(u'Middle Name'), 492 required = False, 493 ) 494 495 lastname = schema.TextLine( 496 title = _(u'Surname'), 497 required = True, 498 ) 499 500 date_of_birth = FormattedDate( 501 title = _(u'Date of Birth'), 502 required = False, 503 #date_format = u'%d/%m/%Y', # Use grok-instance-wide default 504 show_year = True, 505 ) 506 507 sex = schema.Choice( 508 title = _(u'Gender'), 509 source = GenderSource(), 510 required = True, 511 ) 512 513 nationality = schema.Choice( 514 vocabulary = nats_vocab, 515 title = _(u'Nationality'), 516 required = False, 517 ) 518 519 email = schema.ASCIILine( 520 title = _(u'Email Address'), 521 required = True, 522 constraint=validate_email, 523 ) 524 525 phone = PhoneNumber( 526 title = _(u'Phone'), 527 description = u'', 528 required = False, 529 ) 530 531 work = schema.TextLine( 532 title = _(u'Place of Work'), 533 required = False, 534 ) 535 536 hq_obtained = schema.Choice( 537 title = _(u'Highest Qualification Obtained'), 538 required = False, 539 readonly = False, 540 vocabulary = high_qual, 541 ) 542 543 hq_date = FormattedDate( 544 title = _(u'Highest Qualification Date'), 545 required = False, 546 readonly = False, 547 show_year = True, 548 ) 549 proficiency = schema.Choice( 550 source = ProficiencySource(), 551 title = _(u'Level of Proficiency'), 552 required = False, 553 ) 554 555 guarantor = schema.TextLine( 556 title = _(u'Name of Guarantor'), 557 required = False, 558 ) 446 559 447 560 class ICustomUGApplicant(IApplicantBaseData, IBankAccount): … … 670 783 671 784 class ICustomApplicant(ICustomUGApplicant, ICustomPGApplicant, 672 IUnibenRegistration, ITranscriptApplicant ):785 IUnibenRegistration, ITranscriptApplicant, IFrenchApplicant): 673 786 """An interface for both types of applicants. 674 787 -
main/waeup.uniben/trunk/src/waeup/uniben/applicants/utils.py
r16547 r16804 68 68 'tscf': ['Transcript (without student record)', 'TRF'], 69 69 'tscs': ['Transcript (with student record)', 'TRS'], 70 'french': ['French Language Centre', 'FR'], 70 71 } 71 72
Note: See TracChangeset for help on using the changeset viewer.