Changeset 8072


Ignore:
Timestamp:
9 Apr 2012, 07:53:53 (12 years ago)
Author:
Henrik Bettermann
Message:

Doing the same in custom.

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

Legend:

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

    r8054 r8072  
    2121from zope import schema
    2222from waeup.kofa.applicants.interfaces import IApplicantBaseData
     23from waeup.kofa.students.vocabularies import nats_vocab
     24from waeup.custom.interfaces import lgas_vocab
    2325from waeup.custom.interfaces import MessageFactory as _
    2426
     
    2830    """
    2931
     32    nationality = schema.Choice(
     33        source = nats_vocab,
     34        title = _(u'Nationality'),
     35        required = False,
     36        )
     37    lga = schema.Choice(
     38        source = lgas_vocab,
     39        title = _(u'State/LGA (Nigerians only)'),
     40        required = False,
     41        )
     42
     43# This ordering doesn't work properly.
     44IUGApplicant[
     45    'nationality'].order =  IApplicantBaseData['sex'].order
     46IUGApplicant[
     47    'lga'].order =  IUGApplicant['nationality'].order
     48
    3049class IPGApplicant(IApplicantBaseData):
    3150    """A postgraduate applicant.
     
    3352    """
    3453
     54    nationality = schema.Choice(
     55        source = nats_vocab,
     56        title = _(u'Nationality'),
     57        required = False,
     58        )
     59    lga = schema.Choice(
     60        source = lgas_vocab,
     61        title = _(u'State/LGA (Nigerians only)'),
     62        required = False,
     63        )
    3564    employer = schema.TextLine(
    3665        title = _(u'Employer'),
     
    3867        readonly = False,
    3968        )
     69
     70# This ordering doesn't work properly.
     71IPGApplicant[
     72    'nationality'].order =  IApplicantBaseData['sex'].order
     73IPGApplicant[
     74    'lga'].order =  IPGApplicant['nationality'].order
     75IPGApplicant[
     76    'student_id'].order =  IPGApplicant['notice'].order
    4077
    4178class IApplicant(IUGApplicant,IPGApplicant):
  • main/waeup.custom/trunk/src/waeup/custom/applicants/tests.py

    r8055 r8072  
    196196            'applicant_id,application_date,application_number,course1,course2,'
    197197            'course_admitted,date_of_birth,display_fullname,email,employer,'
    198             'firstname,history,lastname,lga,locked,middlename,notice,password,'
    199             'phone,reg_number,screening_score,screening_venue,sex,state,'
    200             'student_id'
     198            'firstname,history,lastname,lga,locked,middlename,nationality,'
     199            'notice,password,phone,reg_number,screening_score,screening_venue,'
     200            'sex,state,student_id'
    201201            in result)
    202202        self.assertTrue(
    203             'Application initialized by system\'],Tester,foreigner,0,M.,'
     203            'Application initialized by system\'],Tester,,0,M.,,'
    204204            '"Some notice\nin lines.",any password,+234-123-12345,123456,98,'
    205205            'Exam Room,f,initialized,' in result)
  • main/waeup.custom/trunk/src/waeup/custom/interfaces.py

    r7928 r8072  
    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.custom.utils.lgas import LGAS
    2324
    2425_ = MessageFactory = zope.i18nmessageid.MessageFactory('waeup.custom')
     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.custom/trunk/src/waeup/custom/students/interfaces.py

    r7995 r8072  
    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.custom.interfaces import lgas_vocab
     29from waeup.custom.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.