Changeset 8928 for main/waeup.uniben/trunk/src/waeup
- Timestamp:
- 7 Jul 2012, 09:25:03 (12 years ago)
- Location:
- main/waeup.uniben/trunk/src/waeup/uniben/applicants
- Files:
-
- 4 added
- 1 deleted
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.uniben/trunk/src/waeup/uniben/applicants/applicant.py
r8668 r8928 22 22 from waeup.kofa.utils.helpers import attrs_to_fields 23 23 from waeup.uniben.applicants.interfaces import( 24 ICustomApplicant, I UGApplicantEdit, IPGApplicantEdit, IPUTMEApplicantEdit)24 ICustomApplicant, ICustomUGApplicantEdit, ICustomPGApplicantEdit, IPUTMEApplicantEdit) 25 25 26 26 class CustomApplicant(Applicant): 27 27 28 grok.implements(ICustomApplicant, I UGApplicantEdit,29 I PGApplicantEdit, IPUTMEApplicantEdit)28 grok.implements(ICustomApplicant, ICustomUGApplicantEdit, 29 ICustomPGApplicantEdit, IPUTMEApplicantEdit) 30 30 grok.provides(ICustomApplicant) 31 31 -
main/waeup.uniben/trunk/src/waeup/uniben/applicants/browser.py
r8839 r8928 36 36 from waeup.kofa.applicants.pdf import PDFApplicationSlip 37 37 from waeup.uniben.applicants.interfaces import ( 38 I PGApplicant, IUGApplicant, IPGApplicantEdit, IUGApplicantEdit,38 ICustomPGApplicant, ICustomUGApplicant, ICustomPGApplicantEdit, ICustomUGApplicantEdit, 39 39 ICustomApplicantOnlinePayment, IPUTMEApplicantEdit, 40 40 UG_OMIT_DISPLAY_FIELDS, PG_OMIT_DISPLAY_FIELDS, … … 81 81 target = getattr(self.context.__parent__, 'prefix', None) 82 82 if target is not None and target.startswith('pg'): 83 form_fields = grok.AutoFields(I PGApplicant)83 form_fields = grok.AutoFields(ICustomPGApplicant) 84 84 for field in PG_OMIT_PDF_FIELDS: 85 85 form_fields = form_fields.omit(field) 86 86 else: 87 form_fields = grok.AutoFields(I UGApplicant)87 form_fields = grok.AutoFields(ICustomUGApplicant) 88 88 if self._reduced_slip(): 89 89 for field in UG_OMIT_RESULT_SLIP_FIELDS: … … 104 104 target = getattr(self.context.__parent__, 'prefix', None) 105 105 if target is not None and target.startswith('pg'): 106 form_fields = grok.AutoFields(I PGApplicant)106 form_fields = grok.AutoFields(ICustomPGApplicant) 107 107 for field in PG_OMIT_DISPLAY_FIELDS: 108 108 form_fields = form_fields.omit(field) 109 109 else: 110 form_fields = grok.AutoFields(I UGApplicant)110 form_fields = grok.AutoFields(ICustomUGApplicant) 111 111 for field in UG_OMIT_DISPLAY_FIELDS: 112 112 form_fields = form_fields.omit(field) … … 121 121 target = getattr(self.context.__parent__, 'prefix', None) 122 122 if target is not None and target.startswith('pg'): 123 form_fields = grok.AutoFields(I PGApplicant)123 form_fields = grok.AutoFields(ICustomPGApplicant) 124 124 for field in PG_OMIT_MANAGE_FIELDS: 125 125 form_fields = form_fields.omit(field) 126 126 else: 127 form_fields = grok.AutoFields(I UGApplicant)127 form_fields = grok.AutoFields(ICustomUGApplicant) 128 128 for field in UG_OMIT_MANAGE_FIELDS: 129 129 form_fields = form_fields.omit(field) … … 140 140 target = getattr(self.context.__parent__, 'prefix', None) 141 141 if target is not None and target.startswith('pg'): 142 form_fields = grok.AutoFields(I PGApplicantEdit)142 form_fields = grok.AutoFields(ICustomPGApplicantEdit) 143 143 for field in PG_OMIT_EDIT_FIELDS: 144 144 form_fields = form_fields.omit(field) … … 148 148 form_fields = form_fields.omit(field) 149 149 else: 150 form_fields = grok.AutoFields(I UGApplicantEdit)150 form_fields = grok.AutoFields(ICustomUGApplicantEdit) 151 151 for field in UG_OMIT_EDIT_FIELDS: 152 152 form_fields = form_fields.omit(field) … … 164 164 form_fields[ 165 165 'payment_date'].custom_widget = FriendlyDatetimeDisplayWidget('le') 166 167 class CustomApplicationFeePaymentAddPage(ApplicationFeePaymentAddPage):168 """ Page to add an online payment ticket169 """170 factory = u'waeup.CustomApplicantOnlinePayment'171 166 172 167 class CustomExportPDFPaymentSlipPage(ExportPDFPaymentSlipPage): -
main/waeup.uniben/trunk/src/waeup/uniben/applicants/export.py
r8441 r8928 21 21 from waeup.kofa.applicants.interfaces import IApplicantBaseData 22 22 from waeup.kofa.applicants.export import ApplicantsExporter 23 from waeup.uniben.applicants.interfaces import I UGApplicant, IPGApplicant23 from waeup.uniben.applicants.interfaces import ICustomUGApplicant, ICustomPGApplicant 24 24 25 25 class CustomApplicantsExporter(ApplicantsExporter): … … 28 28 29 29 fields = tuple(sorted(set( 30 I UGApplicant.names() +31 I PGApplicant.names() +30 ICustomUGApplicant.names() + 31 ICustomPGApplicant.names() + 32 32 IApplicantBaseData.names() 33 33 ))) + ('container_code',) -
main/waeup.uniben/trunk/src/waeup/uniben/applicants/interfaces.py
r8844 r8928 29 29 from waeup.kofa.students.vocabularies import nats_vocab, GenderSource 30 30 from waeup.kofa.applicants.interfaces import contextual_reg_num_source 31 from kofacustom.nigeria.interfaces import ( 32 LGASource, high_qual, high_grade, exam_types) 31 from kofacustom.nigeria.applicants.interfaces import ( 32 LGASource, high_qual, high_grade, exam_types, 33 INigeriaUGApplicant, INigeriaPGApplicant, 34 INigeriaApplicantOnlinePayment, 35 UG_OMIT_DISPLAY_FIELDS, 36 UG_OMIT_PDF_FIELDS, 37 UG_OMIT_MANAGE_FIELDS, 38 UG_OMIT_EDIT_FIELDS, 39 PUTME_OMIT_EDIT_FIELDS, 40 UG_OMIT_RESULT_SLIP_FIELDS, 41 PG_OMIT_DISPLAY_FIELDS, 42 PG_OMIT_PDF_FIELDS, 43 PG_OMIT_MANAGE_FIELDS, 44 PG_OMIT_EDIT_FIELDS, 45 ) 33 46 from waeup.uniben.interfaces import MessageFactory as _ 34 47 from waeup.uniben.payments.interfaces import ICustomOnlinePayment … … 43 56 ############################################################ 44 57 45 UG_OMIT_DISPLAY_FIELDS = ('locked', 'course_admitted', 46 'password', 'result_uploaded') 47 UG_OMIT_PDF_FIELDS = UG_OMIT_DISPLAY_FIELDS + ('email', 'phone') 48 UG_OMIT_MANAGE_FIELDS = () 49 UG_OMIT_EDIT_FIELDS = UG_OMIT_MANAGE_FIELDS + ('locked', 'course_admitted', 50 'student_id', 'screening_score', 'screening_venue', 'notice', 51 'screening_date', 'result_uploaded') 52 PUTME_OMIT_EDIT_FIELDS = UG_OMIT_EDIT_FIELDS + ( 53 'firstname', 'middlename', 'lastname', 'sex', 54 'course1', 'lga', 'jamb_score', 'jamb_subjects') 55 UG_OMIT_RESULT_SLIP_FIELDS = UG_OMIT_DISPLAY_FIELDS + ('email', 'phone', 56 'date_of_birth', 'sex', 57 'nationality', 'lga', 'perm_address', 'course2', 'screening_venue', 58 'screening_date') 59 60 PG_OMIT_DISPLAY_FIELDS = ('locked', 'course_admitted', 'password') 61 PG_OMIT_PDF_FIELDS = UG_OMIT_DISPLAY_FIELDS + ('email', 'phone') 62 PG_OMIT_MANAGE_FIELDS = () 63 PG_OMIT_EDIT_FIELDS = PG_OMIT_MANAGE_FIELDS + ( 64 'locked', 'course_admitted', 65 'student_id', 'screening_score', 'screening_venue', 'notice', 66 'screening_date') 67 68 class IUGApplicant(IApplicantBaseData): 58 class ICustomUGApplicant(INigeriaUGApplicant): 69 59 """An undergraduate applicant. 70 60 … … 146 136 ) 147 137 148 class I PGApplicant(IApplicantBaseData):138 class ICustomPGApplicant(INigeriaPGApplicant): 149 139 """A postgraduate applicant. 150 140 … … 325 315 ) 326 316 327 class ICustomApplicant(I UGApplicant, IPGApplicant):317 class ICustomApplicant(ICustomUGApplicant, ICustomPGApplicant): 328 318 """An interface for both types of applicants. 329 319 330 Attention: The I PGApplicant field seetings will be overwritten331 by I PGApplicant field settings. If a field is defined320 Attention: The ICustomPGApplicant field seetings will be overwritten 321 by ICustomPGApplicant field settings. If a field is defined 332 322 in both interfaces zope.schema validates only against the 333 constraints in I UGApplicant. This does not affect the forms334 since they are build on either I UGApplicant or IPGApplicant.323 constraints in ICustomUGApplicant. This does not affect the forms 324 since they are build on either ICustomUGApplicant or ICustomPGApplicant. 335 325 """ 336 326 … … 344 334 """ 345 335 346 class I UGApplicantEdit(IUGApplicant):336 class ICustomUGApplicantEdit(ICustomUGApplicant): 347 337 """An undergraduate applicant interface for edit forms. 348 338 … … 367 357 ) 368 358 369 I UGApplicantEdit[370 'date_of_birth'].order = I UGApplicant['date_of_birth'].order371 I UGApplicantEdit[372 'email'].order = I UGApplicant['email'].order373 374 class I PGApplicantEdit(IPGApplicant):359 ICustomUGApplicantEdit[ 360 'date_of_birth'].order = ICustomUGApplicant['date_of_birth'].order 361 ICustomUGApplicantEdit[ 362 'email'].order = ICustomUGApplicant['email'].order 363 364 class ICustomPGApplicantEdit(ICustomPGApplicant): 375 365 """A postgraduate applicant interface for editing. 376 366 … … 395 385 ) 396 386 397 I PGApplicantEdit[398 'date_of_birth'].order = I PGApplicant['date_of_birth'].order399 I PGApplicantEdit[400 'email'].order = I PGApplicant['email'].order401 402 class ICustomApplicantOnlinePayment(I CustomOnlinePayment):387 ICustomPGApplicantEdit[ 388 'date_of_birth'].order = ICustomPGApplicant['date_of_birth'].order 389 ICustomPGApplicantEdit[ 390 'email'].order = ICustomPGApplicant['email'].order 391 392 class ICustomApplicantOnlinePayment(INigeriaApplicantOnlinePayment): 403 393 """An applicant payment via payment gateways. 404 394 405 395 """ 406 396 407 class IPUTMEApplicantEdit(I UGApplicant):397 class IPUTMEApplicantEdit(ICustomUGApplicant): 408 398 """An undergraduate applicant interface for editing. 409 399 … … 428 418 429 419 IPUTMEApplicantEdit[ 430 'date_of_birth'].order = I UGApplicant['date_of_birth'].order420 'date_of_birth'].order = ICustomUGApplicant['date_of_birth'].order 431 421 IPUTMEApplicantEdit[ 432 'email'].order = I UGApplicant['email'].order422 'email'].order = ICustomUGApplicant['email'].order 433 423 434 424 class ICustomApplicantUpdateByRegNo(ICustomApplicant): -
main/waeup.uniben/trunk/src/waeup/uniben/applicants/payment.py
r8421 r8928 48 48 """ 49 49 grok.implements(IFactory) 50 grok.name(u'waeup. CustomApplicantOnlinePayment')50 grok.name(u'waeup.ApplicantOnlinePayment') 51 51 title = u"Create a new online payment.", 52 52 description = u"This factory instantiates new online payment instances."
Note: See TracChangeset for help on using the changeset viewer.