- Timestamp:
- 7 Mar 2012, 09:06:12 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/branches/ulif-schoolgrades/src/waeup/sirp/applicants/interfaces.py
r7770 r7772 31 31 from waeup.sirp.schema import TextLineChoice 32 32 from waeup.sirp.interfaces import ( 33 ISIRPObject, year_range, validate_email, academic_sessions_vocab) 33 ISIRPObject, year_range, validate_email, academic_sessions_vocab, 34 SubjectSource, GradeSource) 34 35 from waeup.sirp.interfaces import MessageFactory as _ 35 36 from waeup.sirp.university.vocabularies import ( … … 79 80 directlyProvides(contextual_reg_num_source, IContextSourceBinder) 80 81 81 SUBJECTS = dict(math=_(u'Math'),82 bio=_(u'Biology'),83 eng=_(u'English'),84 )85 class SubjectSource(BasicSourceFactory):86 def getValues(self):87 return sorted(SUBJECTS.keys())88 def getTitle(self, value):89 return SUBJECTS.get(value, None)90 91 GRADES = {'A':_(u'Very Good'),92 'B':_(u'Good'),93 'C':_(u'Satisfactory'),94 'D':_(u'Sufficient'),95 'E':_(u'Fail'),96 }97 class GradeSource(BasicSourceFactory):98 def getValues(self):99 return sorted(GRADES.keys())100 def getTitle(self, value):101 return GRADES.get(value, None)102 82 103 83 class AppCatCertificateSource(CertificateSource): … … 384 364 # ) 385 365 grade = schema.Choice( 386 title = _(u'Gra fde'),366 title = _(u'Grade'), 387 367 source = GradeSource(), 388 368 )
Note: See TracChangeset for help on using the changeset viewer.