Changeset 16062 for main/kofacustom.iuokada/trunk/src/kofacustom
- Timestamp:
- 20 Apr 2020, 08:40:41 (5 years ago)
- Location:
- main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/applicants
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/applicants/applicant.py
r15947 r16062 22 22 from waeup.kofa.interfaces import IExtFileStore 23 23 from waeup.kofa.applicants.applicant import ApplicantFactory 24 from waeup.kofa.applicants.refereereport import ( 25 ApplicantRefereeReport, ApplicantRefereeReportFactory) 24 26 from waeup.kofa.utils.helpers import attrs_to_fields 25 27 from kofacustom.nigeria.applicants.applicant import NigeriaApplicant 26 28 from kofacustom.iuokada.applicants.interfaces import( 27 ICustomApplicant, ICustomUGApplicantEdit, ICustomPGApplicantEdit, IPUTMEApplicantEdit) 29 ICustomApplicant, ICustomUGApplicantEdit, ICustomPGApplicantEdit, 30 IPUTMEApplicantEdit, ICustomApplicantRefereeReport) 28 31 29 32 class CustomApplicant(NigeriaApplicant): … … 33 36 grok.provides(ICustomApplicant) 34 37 35 # Set all attributes of CustomApplicant required in ICustomApplicant as field36 # properties. Doing this, we do not have to set initial attributes37 # ourselves and as a bonus we get free validation when an attribute is38 # set.39 38 CustomApplicant = attrs_to_fields(CustomApplicant) 40 39 … … 48 47 def getInterfaces(self): 49 48 return implementedBy(CustomApplicant) 49 50 class CustomApplicantRefereeReport(ApplicantRefereeReport): 51 """This is a custom referee report. 52 """ 53 grok.implements(ICustomApplicantRefereeReport) 54 grok.provides(ICustomApplicantRefereeReport) 55 56 CustomApplicantRefereeReport = attrs_to_fields(CustomApplicantRefereeReport) 57 58 class CustomApplicantRefereeReportFactory(ApplicantRefereeReportFactory): 59 """A factory for applicant online payments. 60 """ 61 62 def __call__(self, *args, **kw): 63 return CustomApplicantRefereeReport() 64 65 def getInterfaces(self): 66 return implementedBy(CustomApplicantRefereeReport) 67 -
main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/applicants/browser.py
r16054 r16062 26 26 from waeup.kofa.utils.helpers import string_from_bytes, file_size, now 27 27 from waeup.kofa.applicants.browser import ( 28 ApplicantRegistrationPage, ApplicantsContainerPage, AdditionalFile) 28 ApplicantRegistrationPage, ApplicantsContainerPage, AdditionalFile, 29 RefereeReportAddFormPage, ExportPDFReportSlipPage, ExportPDFReportSlipPage2, 30 RefereeReportDisplayFormPage) 29 31 from waeup.kofa.applicants.interfaces import ( 30 32 ISpecialApplicant, IApplicantsContainer) … … 51 53 ICustomPGApplicant, ICustomUGApplicant, ICustomApplicant, 52 54 ICustomPGApplicantEdit, ICustomUGApplicantEdit, 53 ICustomApplicantOnlinePayment 55 ICustomApplicantOnlinePayment, ICustomApplicantRefereeReport 54 56 ) 55 57 from kofacustom.iuokada.interfaces import MessageFactory as _ … … 246 248 return form_fields 247 249 250 class RefereeReportAddFormPage(RefereeReportAddFormPage): 251 """Add-form to add an referee report. This form 252 is protected by a mandate. 253 """ 254 form_fields = grok.AutoFields( 255 ICustomApplicantRefereeReport).omit('creation_date') 256 257 class CustomRefereeReportDisplayFormPage(RefereeReportDisplayFormPage): 258 """A display view for referee reports. 259 """ 260 form_fields = grok.AutoFields(ICustomApplicantRefereeReport) 261 form_fields[ 262 'creation_date'].custom_widget = FriendlyDatetimeDisplayWidget('le') 263 264 265 class CustomExportPDFReportSlipPage(ExportPDFReportSlipPage): 266 form_fields = grok.AutoFields(ICustomApplicantRefereeReport) 267 form_fields[ 268 'creation_date'].custom_widget = FriendlyDatetimeDisplayWidget('le') 269 270 class CustomExportPDFReportSlipPage2(ExportPDFReportSlipPage2): 271 form_fields = grok.AutoFields(ICustomApplicantRefereeReport) 272 form_fields[ 273 'creation_date'].custom_widget = FriendlyDatetimeDisplayWidget('le') 274 248 275 class ResultStatement(AdditionalFile): 249 276 grok.name('res_stat.pdf') -
main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/applicants/interfaces.py
r16049 r16062 29 29 from waeup.kofa.students.vocabularies import nats_vocab, GenderSource 30 30 from waeup.kofa.applicants.interfaces import ( 31 contextual_reg_num_source, IApplicantBaseData )31 contextual_reg_num_source, IApplicantBaseData, IApplicantRefereeReport) 32 32 from waeup.kofa.refereeentries import RefereeEntryField 33 33 from kofacustom.nigeria.applicants.interfaces import ( … … 70 70 ) 71 71 72 rating_vocab = SimpleKofaVocabulary( 73 (_('Excellent'), 'e'), 74 (_('Very good'), 'vg'), 75 (_('Good'), 'g'), 76 (_('Slightly above average'), 'saa'), 77 (_('Average'), 'a'), 78 (_('Below average'), 'ba'), 79 (_('Unable to assess'), 'unable'), 80 ) 81 82 83 overallpromise_vocab = SimpleKofaVocabulary( 84 (_('Very good (highest 10%'), 'vg'), 85 (_('Above average (next 15%)'), 'aa'), 86 (_('Average (middle 20%)'), 'a'), 87 (_('Below average (middle 40%)'), 'ba'), 88 ) 89 72 90 class ICustomUGApplicant(IApplicantBaseData): 73 91 """An undergraduate applicant. … … 418 436 the applicant object. 419 437 """ 438 439 class ICustomApplicantRefereeReport(IApplicantRefereeReport): 440 """A referee report. 441 """ 442 443 duration = schema.Text( 444 title = _(u'How long and in what capacity have you known the candidate?'), 445 required = False, 446 ) 447 448 itellectual = schema.Choice( 449 title = _(u'Intellectual Capacity'), 450 required = False, 451 readonly = False, 452 vocabulary = rating_vocab, 453 ) 454 455 persistent = schema.Choice( 456 title = _(u'Capacity for Persistent and Independent Academic Study'), 457 required = False, 458 readonly = False, 459 vocabulary = rating_vocab, 460 ) 461 462 imaginative = schema.Choice( 463 title = _(u'Ability for Imaginative Thought'), 464 required = False, 465 readonly = False, 466 vocabulary = rating_vocab, 467 ) 468 469 productive = schema.Choice( 470 title = _(u'Promise of Productive Scholarship'), 471 required = False, 472 readonly = False, 473 vocabulary = rating_vocab, 474 ) 475 476 previous = schema.Choice( 477 title = _(u'Quality of Previous Work'), 478 required = False, 479 readonly = False, 480 vocabulary = rating_vocab, 481 ) 482 483 expression = schema.Choice( 484 title = _(u'Oral and Written Expression in English'), 485 required = False, 486 readonly = False, 487 vocabulary = rating_vocab, 488 ) 489 490 personality = schema.Text( 491 title = _(u'Please comment on the candidate\'s personality ' 492 'with particular reference to his/her moral character, emotional ' 493 'and physical stabilty'), 494 required = False, 495 ) 496 497 promise = schema.Choice( 498 title = _(u'Candidate\'s overall promise'), 499 required = False, 500 readonly = False, 501 vocabulary = overallpromise_vocab, 502 ) 503 504 report = schema.Text( 505 title = _(u'Any other relevant information which would help ' 506 'in determining the candidate\'s suitability?'), 507 required = False, 508 ) 509 510 objection = schema.Text( 511 title = _(u'Have you any objection to the contents of this ' 512 'evaluation being disclosed to any award-given body if ' 513 'the need arises?'), 514 required = False, 515 ) -
main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/applicants/utils.py
r16054 r16062 91 91 """ 92 92 try: title = "%s / %s / %s (%s)" % ( 93 value.__parent__.__parent__.__parent__. code,94 value.__parent__.__parent__. code,93 value.__parent__.__parent__.__parent__.longtitle, 94 value.__parent__.__parent__.longtitle, 95 95 value.title, value.code) 96 96 except AttributeError:
Note: See TracChangeset for help on using the changeset viewer.