- Timestamp:
- 27 Apr 2023, 11:37:37 (20 months ago)
- Location:
- main/waeup.uniben/trunk/src/waeup/uniben/students
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.uniben/trunk/src/waeup/uniben/students/browser.py
r17362 r17395 76 76 ICustomStudentPersonalEdit, 77 77 IMedicalHistory, 78 ITiship, 78 79 ICustomCourseTicket) 79 80 from waeup.uniben.students.deplinks import DEPLINKS … … 462 463 """ 463 464 464 form_fields = grok.AutoFields(ICustomStudentPersonal) 465 form_fields = grok.AutoFields(ICustomStudentPersonal) + grok.AutoFields(ITiship) 465 466 form_fields['perm_address'].custom_widget = BytesDisplayWidget 466 467 form_fields['next_kin_address'].custom_widget = BytesDisplayWidget … … 473 474 """ 474 475 475 form_fields = grok.AutoFields(ICustomStudentPersonal) 476 form_fields = grok.AutoFields(ICustomStudentPersonal) + grok.AutoFields(ITiship) 476 477 form_fields['personal_updated'].for_display = True 477 478 form_fields[ … … 481 482 """ Page to edit personal data 482 483 """ 483 form_fields = grok.AutoFields( 484 ICustomStudentPersonalEdit).omit('personal_updated') 484 485 @property 486 def form_fields(self): 487 form_fields = grok.AutoFields( 488 ICustomStudentPersonalEdit).omit('personal_updated') + grok.AutoFields(ITiship) 489 studycourse = self.context['studycourse'] 490 certificate = getattr(studycourse,'certificate',None) 491 current_level = studycourse.current_level 492 end_level = certificate.end_level 493 if not self.context.current_level >= end_level: 494 form_fields = form_fields.omit('nysc') 495 return form_fields 485 496 486 497 class StudyCourseCOEditFormPage(KofaEditFormPage): … … 852 863 @property 853 864 def form_fields(self): 854 form_fields = grok.AutoFields(IMedicalHistory) 865 form_fields = grok.AutoFields(IMedicalHistory) + grok.AutoFields(ITiship) 855 866 form_fields['medical_updated'].for_display = True 856 867 for field in ('fever', 'headaches', 'catarrh', 'cough', 'sore_throat', … … 929 940 grok.require('waeup.viewStudent') 930 941 prefix = 'form' 931 form_fields = grok.AutoFields(IMedicalHistory).select( 932 'genotype', 'bloodgroup') 942 form_fields = grok.AutoFields(ITiship) 933 943 title = '' 934 944 -
main/waeup.uniben/trunk/src/waeup/uniben/students/export.py
r16837 r17395 148 148 IMedicalHistory, exclude_attribs=False,))) + ( 149 149 'student_id','display_fullname', 'matric_number', 'faccode', 150 'depcode', 'state','current_session', 'current_level' )150 'depcode', 'state','current_session', 'current_level', 'genotype', 'bloodgroup') 151 151 title = 'Medical Questionnaire Data' 152 152 … … 161 161 'matric_number', 'faccode', 162 162 'depcode', 'state','current_session', 163 'current_level') and student is not None: 163 'current_level', 164 'genotype', 'bloodgroup') and student is not None: 164 165 value = getattr(student, name, None) 165 166 return super( -
main/waeup.uniben/trunk/src/waeup/uniben/students/interfaces.py
r17255 r17395 215 215 ) 216 216 217 218 # Tiship form 217 class ITiship(IKofaObject): 218 """Student tiship data. 219 """ 219 220 220 221 genotype = schema.TextLine( … … 238 239 ) 239 240 241 nysc = schema.Bool( 242 title = _(u'Applying for NYSC'), 243 default = False, 244 required = True, 245 ) 246 240 247 class ICustomStudentPersonalEdit(INigeriaStudentPersonalEdit): 241 248 """Interface for editing personal data by students. … … 248 255 ) 249 256 257 nysc = schema.Bool( 258 title = _(u'Do you want to apply for NYSC?'), 259 default = False, 260 description = u'Ensure that all your school charges are paid up to date to your graduating session before making this nysc application.', 261 required = True, 262 ) 263 250 264 class ICustomUGStudentClearance(INigeriaUGStudentClearance): 251 265 """Representation of ug student clearance data. … … 257 271 258 272 class ICustomStudent(ICustomStudentBase, ICustomUGStudentClearance, 259 ICustomPGStudentClearance, ICustomStudentPersonal, IMedicalHistory): 273 ICustomPGStudentClearance, ICustomStudentPersonal, IMedicalHistory, 274 ITiship): 260 275 """Representation of a student. 261 276 """ -
main/waeup.uniben/trunk/src/waeup/uniben/students/student.py
r16824 r17395 29 29 from kofacustom.nigeria.students.student import NigeriaStudent 30 30 from waeup.uniben.students.interfaces import ( 31 ICustomStudent, ICustomStudentPersonalEdit, IMedicalHistory )31 ICustomStudent, ICustomStudentPersonalEdit, IMedicalHistory, ITiship) 32 32 33 33 … … 38 38 grok.implements( 39 39 ICustomStudent, IStudentNavigation, ICustomStudentPersonalEdit, 40 IMedicalHistory )40 IMedicalHistory, ITiship) 41 41 grok.provides(ICustomStudent) 42 42 -
main/waeup.uniben/trunk/src/waeup/uniben/students/tests/test_browser.py
r17298 r17395 1226 1226 self.browser.getControl(name="form.genotype").value = 'XYZ' 1227 1227 self.browser.getControl("Save").click() 1228 self.browser.getLink("Base Data").click() 1228 1229 self.browser.getLink("Download TISHIP registration slip").click() 1229 1230 self.assertEqual(self.browser.headers['Status'], '200 Ok') -
main/waeup.uniben/trunk/src/waeup/uniben/students/tests/test_export.py
r17257 r17395 141 141 result = open(self.outfile, 'rb').read() 142 142 self.assertMatches( 143 'asthma,b loodgroup,body_pains,breathing,catarrh,company_confirmed,'144 'company_suspected,cough,diabetes,fever, genotype,headaches,hypertension,'143 'asthma,body_pains,breathing,catarrh,company_confirmed,' 144 'company_suspected,cough,diabetes,fever,headaches,hypertension,' 145 145 'lagos_abuja,medical_updated,medicines,negative,obesity,' 146 146 'others,outside,positive,smell,sneezing,sore_throat,taste,' 147 147 'vaccination,weakness,student_id,display_fullname,' 148 148 'matric_number,faccode,depcode,state,current_session,' 149 'current_level \r\n'150 ',,,,,,,,,,,,,,,,,,,,, ,,1,,,,A111111,Anna M. Tester,234,'151 'NA,NA,created,2012,200 \r\n' , result149 'current_level,genotype,bloodgroup\r\n' 150 ',,,,,,,,,,,,,,,,,,,,,1,,,,A111111,Anna M. Tester,234,' 151 'NA,NA,created,2012,200,,\r\n' , result 152 152 ) 153 153 return -
main/waeup.uniben/trunk/src/waeup/uniben/students/viewlets.py
r17255 r17395 209 209 grok.order(2) 210 210 grok.context(ICustomStudent) 211 grok.view(Student MedicalHistoryEditFormPage)211 grok.view(StudentBaseDisplayFormPage) 212 212 grok.require('waeup.viewStudent') 213 213 icon = 'actionicon_pdf.png'
Note: See TracChangeset for help on using the changeset viewer.