- Timestamp:
- 10 Jul 2015, 11:39:13 (9 years ago)
- Location:
- main/kofacustom.nigeria/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/kofacustom.nigeria/trunk
- Property svn:ignore
-
old new 6 6 parts 7 7 sources 8 uuid.txt 8 9 var
-
- Property svn:ignore
-
main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/applicants/interfaces.py
r13157 r13160 20 20 21 21 from zope import schema 22 from zope.component import getUtility 22 23 from waeup.kofa.applicants.interfaces import ( 23 24 contextual_reg_num_source, … … 26 27 from waeup.kofa.schoolgrades import ResultEntryField 27 28 from waeup.kofa.interfaces import ( 28 SimpleKofaVocabulary, academic_sessions_vocab, validate_email) 29 SimpleKofaVocabulary, 30 academic_sessions_vocab, 31 validate_email, 32 SubjectSource, 33 IKofaUtils) 29 34 from waeup.kofa.schema import FormattedDate, TextLineChoice 30 35 from waeup.kofa.students.vocabularies import nats_vocab, GenderSource … … 34 39 from kofacustom.nigeria.payments.interfaces import INigeriaOnlinePayment 35 40 41 jambsubjects = SimpleKofaVocabulary( 42 (_('Use of English'),'english_language'), 43 (_('Agricultural Science'),'agricultural_science'), 44 (_('Arabic'),'arabic'), 45 (_('Biology'),'biology'), 46 (_('Book Keeping'),'book_keeping'), 47 (_('Chemistry'),'chemistry'), 48 (_('Christian Religious Studies'),'christian_religious_studies'), 49 (_('Commerce'),'commerce'), 50 (_('Economics'),'economics'), 51 (_('Financial Accounting'),'financial_accounting'), 52 (_('Fine Art'),'fine_art'), 53 (_('Food and Nutrition'),'food_and_nutrition'), 54 (_('French'),'french'), 55 (_('Geography'),'geography'), 56 (_('German'),'german'), 57 (_('Government'),'government'), 58 (_('Hausa'),'hausa'), 59 (_('Home Economics'),'home_economics'), 60 (_('History'),'history'), 61 (_('Igbo'),'igbo'), 62 (_('Literature in English'),'literature_in_english'), 63 (_('Literature in Nigerian Languages'),'literature_in_nigerian_languages'), 64 (_('Mathematics'),'mathematics'), 65 (_('Music'),'music'), 66 (_('Physics'),'physics'), 67 (_('Yoruba'),'yoruba'), 68 ) 69 70 class JAMBSubjectSource(SubjectSource): 71 """A source for school subjects used in exam documentation. 72 """ 73 74 def getTitle(self, value): 75 subjects_dict = getUtility(IKofaUtils).EXAM_SUBJECTS_DICT 76 return "%s" % subjects_dict[value] 77 36 78 # Fields to be omitted in all display forms. course_admitted is 37 79 # rendered separately. … … 41 83 42 84 # UG students are all undergraduate students. 43 UG_OMIT_DISPLAY_FIELDS = OMIT_DISPLAY_FIELDS 85 UG_OMIT_DISPLAY_FIELDS = OMIT_DISPLAY_FIELDS + ('jamb_subjects_list',) 44 86 UG_OMIT_PDF_FIELDS = UG_OMIT_DISPLAY_FIELDS + ('phone',) 45 UG_OMIT_MANAGE_FIELDS = ('special_application', )87 UG_OMIT_MANAGE_FIELDS = ('special_application','jamb_subjects_list',) 46 88 UG_OMIT_EDIT_FIELDS = UG_OMIT_MANAGE_FIELDS + OMIT_DISPLAY_FIELDS + ( 47 89 'student_id', … … 50 92 'screening_venue', 51 93 'screening_date', 52 #'jamb_age',94 'jamb_age', 53 95 'jamb_subjects', 54 96 'jamb_score', … … 61 103 'hq_degree', 'hq_school', 62 104 'hq_session', 'hq_disc', 63 'aggregate' )105 'aggregate', 'jamb_subjects') 64 106 CBT_OMIT_DISPLAY_FIELDS = OMIT_DISPLAY_FIELDS + CBT_OMIT_FIELDS 65 CBT_OMIT_MANAGE_FIELDS = UG_OMIT_MANAGE_FIELDS + CBT_OMIT_FIELDS 66 CBT_OMIT_EDIT_FIELDS = UG_OMIT_MANAGE_FIELDS + OMIT_DISPLAY_FIELDS + CBT_OMIT_FIELDS + ( 107 CBT_OMIT_MANAGE_FIELDS = CBT_OMIT_FIELDS + ('special_application',) 108 CBT_OMIT_EDIT_FIELDS = OMIT_DISPLAY_FIELDS + CBT_OMIT_FIELDS + ( 109 'special_application', 67 110 'student_id', 68 111 'notice', … … 81 124 'hq_type', 'hq_matric_no', 82 125 'hq_degree', 'hq_school', 83 'hq_session', 'hq_disc', )126 'hq_session', 'hq_disc', 'jamb_subjects_list') 84 127 PUTME_OMIT_DISPLAY_FIELDS = OMIT_DISPLAY_FIELDS + PUTME_OMIT_FIELDS 85 128 PUTME_OMIT_MANAGE_FIELDS = UG_OMIT_MANAGE_FIELDS + PUTME_OMIT_FIELDS … … 97 140 # PUDE is a subgroup of UG with the same interface. 98 141 PUDE_OMIT_FIELDS = ( 99 'jamb_subjects','jamb_score', 'jamb_age', 'aggregate' )142 'jamb_subjects','jamb_score', 'jamb_age', 'aggregate', 'jamb_subjects_list') 100 143 PUDE_OMIT_DISPLAY_FIELDS = OMIT_DISPLAY_FIELDS + PUDE_OMIT_FIELDS 101 144 PUDE_OMIT_MANAGE_FIELDS = UG_OMIT_MANAGE_FIELDS + PUDE_OMIT_FIELDS … … 188 231 required = False, 189 232 ) 233 jamb_subjects_list = schema.List( 234 title = _(u'JAMB Subjects'), 235 default = ['english',], 236 required = False, 237 value_type = schema.Choice( 238 vocabulary = jambsubjects 239 #source = JAMBSubjectSource(), 240 ), 241 ) 190 242 jamb_score = schema.Int( 191 243 title = _(u'Total JAMB Score'), … … 523 575 show_year = True, 524 576 ) 525 jamb_subjects = schema.Text( 526 title = _(u'Subjects and Scores'), 527 description = _(u'Enter all four subjects, one subject with score per line!'), 528 required = True, 577 jamb_subjects_list = schema.List( 578 title = _(u'JAMB Subjects'), 579 description = _(u'Select four subjects.'), 580 default = ['english',], 581 required = True, 582 value_type = schema.Choice( 583 vocabulary = jambsubjects 584 #source = JAMBSubjectSource(), 585 ), 529 586 ) 530 587 … … 534 591 'email'].order = INigeriaUGApplicant['email'].order 535 592 INigeriaUGApplicantEdit[ 536 'jamb_subjects '].order = INigeriaUGApplicant['jamb_subjects'].order593 'jamb_subjects_list'].order = INigeriaUGApplicant['jamb_subjects_list'].order 537 594 538 595 class INigeriaPGApplicantEdit(INigeriaPGApplicant):
Note: See TracChangeset for help on using the changeset viewer.