Ignore:
Timestamp:
9 Apr 2012, 07:35:03 (13 years ago)
Author:
Henrik Bettermann
Message:

Add nationality and lga fields in interfaces.

Location:
main/waeup.uniben/trunk/src/waeup/uniben
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.uniben/trunk/src/waeup/uniben/applicants/interfaces.py

    r8053 r8071  
    2525from waeup.kofa.schoolgrades import ResultEntryField
    2626from waeup.kofa.interfaces import SimpleKofaVocabulary
     27from waeup.kofa.students.vocabularies import nats_vocab
     28from waeup.uniben.interfaces import lgas_vocab
    2729from waeup.uniben.interfaces import MessageFactory as _
    2830
     
    7678    """
    7779
     80    nationality = schema.Choice(
     81        source = nats_vocab,
     82        title = _(u'Nationality'),
     83        required = False,
     84        )
     85    lga = schema.Choice(
     86        source = lgas_vocab,
     87        title = _(u'State/LGA (Nigerians only)'),
     88        required = False,
     89        )
     90
     91# This ordering doesn't work properly.
     92IUGApplicant[
     93    'nationality'].order =  IApplicantBaseData['sex'].order
     94IUGApplicant[
     95    'lga'].order =  IUGApplicant['nationality'].order
     96
     97
    7898class IPGApplicant(IApplicantBaseData):
    7999    """A postgraduate applicant.
     
    81101    """
    82102
     103    nationality = schema.Choice(
     104        source = nats_vocab,
     105        title = _(u'Nationality'),
     106        required = False,
     107        )
     108    lga = schema.Choice(
     109        source = lgas_vocab,
     110        title = _(u'State/LGA (Nigerians only)'),
     111        required = False,
     112        )
    83113    perm_address = schema.Text(
    84114        title = _(u'Permanent Address'),
     
    206236
    207237
     238# This ordering doesn't work properly.
     239IPGApplicant[
     240    'nationality'].order =  IApplicantBaseData['sex'].order
     241IPGApplicant[
     242    'lga'].order =  IPGApplicant['nationality'].order
    208243IPGApplicant[
    209244    'student_id'].order =  IPGApplicant['notice'].order
     245
    210246
    211247class IApplicant(IUGApplicant,IPGApplicant):
  • main/waeup.uniben/trunk/src/waeup/uniben/applicants/tests.py

    r8064 r8071  
    199199            'emp_start,employer,employer2,firstname,history,hq_degree,hq_disc,'
    200200            'hq_matric_no,hq_school,hq_session,hq_type,lastname,lga,locked,'
    201             'middlename,notice,password,perm_address,phone,pp_school,reg_number,'
    202             'screening_score,screening_venue,sex,state,student_id'
     201            'middlename,nationality,notice,password,perm_address,phone,pp_school,'
     202            'reg_number,screening_score,screening_venue,sex,state,student_id'
    203203            in result)
    204204        self.assertTrue(
    205             'Application initialized by system\'],,,,,,,Tester,foreigner,0,M.,'
     205            'Application initialized by system\'],,,,,,,Tester,,0,M.,,'
    206206            '"Some notice\nin lines.",any password,,+234-123-12345,,123456,98,'
    207207            'Exam Room,f,initialized,' in result)
  • main/waeup.uniben/trunk/src/waeup/uniben/interfaces.py

    r8020 r8071  
    1919import zope.i18nmessageid
    2020from zope import schema
    21 from waeup.kofa.interfaces import (
     21from waeup.kofa.interfaces import (SimpleKofaVocabulary,
    2222    ISessionConfiguration, academic_sessions_vocab)
     23from waeup.uniben.utils.lgas import LGAS
    2324
    2425_ = MessageFactory = zope.i18nmessageid.MessageFactory('waeup.uniben')
     26
     27lgas_vocab = SimpleKofaVocabulary(
     28    *sorted([(x[1],x[0]) for x in LGAS]))
    2529
    2630# It's recommended to replicate all fields from the base package here.
  • main/waeup.uniben/trunk/src/waeup/uniben/students/interfaces.py

    r7995 r8071  
    1919from waeup.kofa.schema import TextLineChoice
    2020from waeup.kofa.interfaces import SimpleKofaVocabulary
     21from waeup.kofa.students.vocabularies import nats_vocab
    2122from waeup.kofa.students.interfaces import (
    2223    IStudentBase,IUGStudentClearance,IPGStudentClearance,
     
    2425    )
    2526from waeup.kofa.students.vocabularies import (
    26     lgas_vocab, nats_vocab, contextual_reg_num_source)
     27    nats_vocab, contextual_reg_num_source)
     28from waeup.uniben.interfaces import lgas_vocab
     29from waeup.uniben.interfaces import MessageFactory as _
    2730
    2831class IStudentBase(IStudentBase):
     
    3235
    3336    reg_number = TextLineChoice(
    34         title = u'Registration Number',
     37        title = _(u'Registration Number'),
    3538        required = False,
    3639        readonly = False,
     
    4851        required = False,
    4952        vocabulary = SimpleKofaVocabulary(
    50             ('Unmarried', 'unmarried'),
    51             ('Married', 'married'),)
     53            (_('Unmarried'), 'unmarried'),
     54            (_('Married'), 'married'),)
    5255        )
    5356
     
    5760    """
    5861    date_of_birth = schema.Date(
    59         title = u'Date of Birth',
     62        title = _(u'Date of Birth'),
    6063        required = False,
    6164        )
     
    6366    nationality = schema.Choice(
    6467        source = nats_vocab,
    65         title = u'Nationality',
    66         default = 'nigeria',
     68        title = _(u'Nationality'),
    6769        required = False,
    6870        )
     
    7072    lga = schema.Choice(
    7173        source = lgas_vocab,
    72         title = u'State/LGA',
     74        title = _(u'State/LGA (Nigerians only)'),
    7375        required = False,
    7476        )
Note: See TracChangeset for help on using the changeset viewer.