Changeset 14250
- Timestamp:
- 2 Nov 2016, 14:42:04 (8 years ago)
- Location:
- main/waeup.aaue/trunk/src/waeup/aaue
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.aaue/trunk/src/waeup/aaue/applicants/tests/test_applicantcopier.py
r13977 r14250 56 56 self.browser.getControl(name="form.fst_sit_no").value = '123' 57 57 self.browser.getControl(name="form.fst_sit_type").value = ['ssce'] 58 self.browser.getControl(name="form.fst_sit_date").value = '01/01/2014' 58 59 self.browser.getControl(name="form.scd_sit_fname").value = 'John' 59 60 self.browser.getControl(name="form.scd_sit_no").value = '456' … … 72 73 self.assertEqual(student.fst_sit_no, '123') 73 74 self.assertEqual(student.fst_sit_type, 'ssce') 75 self.assertEqual(student.fst_sit_date.isoformat(), '2014-01-01') 74 76 self.assertEqual(student.scd_sit_fname, 'John') 75 77 self.assertEqual(student.scd_sit_no, '456') -
main/waeup.aaue/trunk/src/waeup/aaue/students/interfaces.py
r14206 r14250 18 18 19 19 from zope import schema 20 from zope.interface import Attribute 20 from zope.interface import Attribute, invariant 21 21 from zc.sourcefactory.contextual import BasicContextualSourceFactory 22 22 from zope.catalog.interfaces import ICatalog 23 23 from zope.component import getUtility 24 from waeup.kofa.schoolgrades import ResultEntryField 24 25 from waeup.kofa.interfaces import (IKofaObject, academic_sessions_vocab) 25 26 from waeup.kofa.students.vocabularies import ( 26 StudyLevelSource, contextual_reg_num_source 27 StudyLevelSource, contextual_reg_num_source, nats_vocab, 27 28 ) 29 from waeup.kofa.students.interfaces import IUGStudentClearance 28 30 from waeup.kofa.schema import PhoneNumber, FormattedDate, TextLineChoice 29 from kofacustom.nigeria.interfaces import LGASource 31 from kofacustom.nigeria.interfaces import ( 32 LGASource, exam_types, high_qual, high_grade) 30 33 from kofacustom.nigeria.students.interfaces import ( 31 34 INigeriaStudentBase, INigeriaUGStudentClearance, INigeriaPGStudentClearance, … … 214 217 ) 215 218 216 class ICustomUGStudentClearance(I NigeriaUGStudentClearance):219 class ICustomUGStudentClearance(IUGStudentClearance): 217 220 """Representation of ug student clearance data. 218 221 219 222 """ 220 223 221 #date_of_birth = FormattedDate( 222 # title = _(u'Date of Birth'), 223 # required = True, 224 # show_year = True, 225 # ) 224 officer_comment = schema.Text( 225 title = _(u"Officer's Comment"), 226 required = False, 227 ) 228 229 physical_clearance_date = schema.TextLine( 230 title = _(u"Physical Clearance Date"), 231 required = False, 232 ) 233 234 clr_code = schema.TextLine( 235 title = _(u'CLR Activation Code'), 236 required = False, 237 readonly = False, 238 ) 239 240 date_of_birth = FormattedDate( 241 title = _(u'Date of Birth'), 242 required = False, 243 show_year = True, 244 ) 245 246 nationality = schema.Choice( 247 source = nats_vocab, 248 title = _(u'Nationality'), 249 required = True, 250 ) 226 251 227 252 lga = schema.Choice( … … 231 256 ) 232 257 258 def_adm = schema.Bool( 259 title = _(u'Deferment of Admission'), 260 required = False, 261 readonly = False, 262 default = False, 263 ) 264 265 fst_sit_fname = schema.TextLine( 266 title = _(u'Full Name'), 267 required = True, 268 readonly = False, 269 ) 270 fst_sit_no = schema.TextLine( 271 title = _(u'Exam Number'), 272 required = True, 273 readonly = False, 274 ) 275 233 276 fst_sit_sc_pin = schema.TextLine( 234 277 title = _(u'Scratch Card Pin'), 235 required = False,278 required = True, 236 279 readonly = False, 237 280 ) … … 239 282 fst_sit_sc_serial_number = schema.TextLine( 240 283 title = _(u'Scratch Card Serial Number'), 284 required = True, 285 readonly = False, 286 ) 287 288 fst_sit_date = FormattedDate( 289 title = _(u'Exam Date'), 290 required = True, 291 readonly = False, 292 show_year = True, 293 ) 294 295 fst_sit_type = schema.Choice( 296 title = _(u'Exam Type'), 297 required = True, 298 readonly = False, 299 vocabulary = exam_types, 300 ) 301 302 fst_sit_results = schema.List( 303 title = _(u'Exam Results'), 304 value_type = ResultEntryField(), 305 required = True, 306 readonly = False, 307 defaultFactory=list, 308 ) 309 310 scd_sit_fname = schema.TextLine( 311 title = _(u'Full Name'), 312 required = False, 313 readonly = False, 314 ) 315 scd_sit_no = schema.TextLine( 316 title = _(u'Exam Number'), 241 317 required = False, 242 318 readonly = False, … … 255 331 ) 256 332 257 ICustomUGStudentClearance['lga'].order = INigeriaUGStudentClearance[ 258 'lga'].order 259 #ICustomUGStudentClearance['date_of_birth'].order = INigeriaUGStudentClearance[ 260 # 'date_of_birth'].order 261 ICustomUGStudentClearance['fst_sit_sc_pin'].order = INigeriaUGStudentClearance['fst_sit_date'].order 262 ICustomUGStudentClearance['scd_sit_sc_pin'].order = INigeriaUGStudentClearance['scd_sit_date'].order 263 ICustomUGStudentClearance['fst_sit_sc_serial_number'].order = INigeriaUGStudentClearance['fst_sit_date'].order 264 ICustomUGStudentClearance['scd_sit_sc_serial_number'].order = INigeriaUGStudentClearance['scd_sit_date'].order 265 ICustomUGStudentClearance['scd_sit_date'].order = ICustomUGStudentClearance['scd_sit_type'].order 266 ICustomUGStudentClearance['fst_sit_date'].order = ICustomUGStudentClearance['fst_sit_type'].order 333 scd_sit_date = FormattedDate( 334 title = _(u'Exam Date'), 335 required = False, 336 readonly = False, 337 show_year = True, 338 ) 339 340 scd_sit_type = schema.Choice( 341 title = _(u'Exam Type'), 342 required = False, 343 readonly = False, 344 vocabulary = exam_types, 345 ) 346 347 scd_sit_results = schema.List( 348 title = _(u'Exam Results'), 349 value_type = ResultEntryField(), 350 required = False, 351 readonly = False, 352 defaultFactory=list, 353 ) 354 355 356 alr_fname = schema.TextLine( 357 title = _(u'Full Name'), 358 required = False, 359 readonly = False, 360 ) 361 alr_no = schema.TextLine( 362 title = _(u'Exam Number'), 363 required = False, 364 readonly = False, 365 ) 366 367 alr_date = FormattedDate( 368 title = _(u'Exam Date'), 369 required = False, 370 readonly = False, 371 show_year = True, 372 ) 373 374 alr_results = schema.List( 375 title = _(u'Exam Results'), 376 value_type = ResultEntryField(), 377 required = False, 378 readonly = False, 379 defaultFactory=list, 380 ) 381 382 hq_type = schema.Choice( 383 title = _(u'Qualification Obtained'), 384 required = False, 385 readonly = False, 386 vocabulary = high_qual, 387 ) 388 389 hq_fname = schema.TextLine( 390 title = _(u'Full Name'), 391 required = False, 392 readonly = False, 393 ) 394 395 hq_matric_no = schema.TextLine( 396 title = _(u'Former Matric Number'), 397 required = False, 398 readonly = False, 399 ) 400 401 hq_degree = schema.Choice( 402 title = _(u'Class of Degree'), 403 required = False, 404 readonly = False, 405 vocabulary = high_grade, 406 ) 407 408 hq_school = schema.TextLine( 409 title = _(u'Institution Attended'), 410 required = False, 411 readonly = False, 412 ) 413 414 hq_session = schema.TextLine( 415 title = _(u'Years Attended'), 416 required = False, 417 readonly = False, 418 ) 419 420 hq_disc = schema.TextLine( 421 title = _(u'Discipline'), 422 required = False, 423 readonly = False, 424 ) 425 426 @invariant 427 def check_lga_nationality(student): 428 if student.nationality != 'NG' and student.lga not in ('foreigner', None): 429 raise Invalid(_('Nationalty and LGA are contradictory.')) 430 if student.nationality == 'NG' and student.lga == 'foreigner': 431 raise Invalid(_('Nationalty and LGA are contradictory.')) 267 432 268 433
Note: See TracChangeset for help on using the changeset viewer.