Changeset 8504 for main/waeup.fceokene/trunk/src
- Timestamp:
- 23 May 2012, 21:27:57 (13 years ago)
- Location:
- main/waeup.fceokene/trunk/src/waeup/fceokene
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.fceokene/trunk/src/waeup/fceokene/applicants/interfaces.py
r8460 r8504 28 28 from waeup.kofa.students.vocabularies import nats_vocab 29 29 from waeup.fceokene.interfaces import ( 30 lgas_vocab, high_qual, high_grade, exam_types)30 LGASource, high_qual, high_grade, exam_types) 31 31 from waeup.fceokene.interfaces import MessageFactory as _ 32 32 from waeup.fceokene.payments.interfaces import ICustomOnlinePayment … … 43 43 ) 44 44 lga = schema.Choice( 45 source = lgas_vocab,45 source = LGASource(), 46 46 title = _(u'State/LGA (Nigerians only)'), 47 47 required = False, … … 66 66 ) 67 67 lga = schema.Choice( 68 source = lgas_vocab,68 source = LGASource(), 69 69 title = _(u'State/LGA (Nigerians only)'), 70 70 required = False, … … 138 138 ) 139 139 nysc_lga = schema.Choice( 140 source = lgas_vocab,140 source = LGASource(), 141 141 title = _(u'Nysc Location'), 142 142 required = False, -
main/waeup.fceokene/trunk/src/waeup/fceokene/interfaces.py
r8460 r8504 19 19 import zope.i18nmessageid 20 20 from zope import schema 21 from zc.sourcefactory.basic import BasicSourceFactory 21 22 from waeup.kofa.interfaces import (SimpleKofaVocabulary, 22 23 ISessionConfiguration, academic_sessions_vocab) … … 69 70 ) 70 71 72 #lgas_vocab = SimpleKofaVocabulary( 73 # *sorted([(x[1],x[0]) for x in LGAS])) 71 74 72 lgas_vocab = SimpleKofaVocabulary( 73 *sorted([(x[1],x[0]) for x in LGAS])) 75 class LGASource(BasicSourceFactory): 76 """A source for school subjects used in exam documentation. 77 """ 78 lga_dict = dict(LGAS) 79 80 def getValues(self): 81 return sorted(self.lga_dict.keys()) 82 83 def getToken(self, value): 84 return str(value) 85 86 def getTitle(self, value): 87 return self.lga_dict.get(value, 88 _('Invalid key: ${a}', mapping = {'a':value})) 74 89 75 90 # It's recommended to replicate all fields from the base package here. -
main/waeup.fceokene/trunk/src/waeup/fceokene/students/interfaces.py
r8460 r8504 30 30 nats_vocab, contextual_reg_num_source) 31 31 from waeup.fceokene.interfaces import ( 32 lgas_vocab, high_qual, high_grade, exam_types)32 high_qual, high_grade, exam_types, LGASource) 33 33 from waeup.fceokene.interfaces import MessageFactory as _ 34 34 from waeup.fceokene.payments.interfaces import ICustomOnlinePayment 35 from waeup.fceokene.utils.lgas import LGAS 36 35 37 36 38 class ICustomStudentBase(IStudentBase): … … 77 79 78 80 lga = schema.Choice( 79 source = lgas_vocab,81 source = LGASource(), 80 82 title = _(u'State/LGA (Nigerians only)'), 81 83 required = False, … … 269 271 270 272 nysc_lga = schema.Choice( 271 source = lgas_vocab,273 source = LGASource(), 272 274 title = _(u'Nysc Location'), 273 275 required = False,
Note: See TracChangeset for help on using the changeset viewer.