Ignore:
Timestamp:
26 Apr 2015, 12:50:43 (10 years ago)
Author:
Henrik Bettermann
Message:

Customize PUTME and PUDE forms.

Location:
main/kofacustom.wdu/trunk/src/kofacustom/wdu/applicants
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • main/kofacustom.wdu/trunk/src/kofacustom/wdu/applicants/applicant.py

    r11940 r12887  
    2323from kofacustom.nigeria.applicants.applicant import NigeriaApplicant
    2424from kofacustom.wdu.applicants.interfaces import(
    25     ICustomApplicant, ICustomUGApplicantEdit, ICustomPGApplicantEdit, IPUTMEApplicantEdit)
     25    ICustomApplicant,
     26    ICustomUGApplicantEdit,
     27    ICustomPGApplicantEdit,
     28    ICustomPUTMEApplicantEdit
     29    )
    2630
    2731class CustomApplicant(NigeriaApplicant):
    2832
    2933    grok.implements(ICustomApplicant, ICustomUGApplicantEdit,
    30         ICustomPGApplicantEdit, IPUTMEApplicantEdit)
     34        ICustomPGApplicantEdit, ICustomPUTMEApplicantEdit)
    3135    grok.provides(ICustomApplicant)
    3236
  • main/kofacustom.wdu/trunk/src/kofacustom/wdu/applicants/browser.py

    r12885 r12887  
    3131
    3232from kofacustom.nigeria.applicants.interfaces import (
    33     UG_OMIT_DISPLAY_FIELDS,
    34     UG_OMIT_PDF_FIELDS,
    35     UG_OMIT_MANAGE_FIELDS,
    36     UG_OMIT_EDIT_FIELDS,
    37     PUTME_OMIT_DISPLAY_FIELDS,
    38     PUTME_OMIT_PDF_FIELDS,
    39     PUTME_OMIT_MANAGE_FIELDS,
    40     PUTME_OMIT_EDIT_FIELDS,
    41     PUTME_OMIT_RESULT_SLIP_FIELDS,
    42     PUDE_OMIT_DISPLAY_FIELDS,
    43     PUDE_OMIT_PDF_FIELDS,
    44     PUDE_OMIT_MANAGE_FIELDS,
    45     PUDE_OMIT_EDIT_FIELDS,
    46     PUDE_OMIT_RESULT_SLIP_FIELDS,
     33    OMIT_DISPLAY_FIELDS,
     34    #UG_OMIT_DISPLAY_FIELDS,
     35    #UG_OMIT_PDF_FIELDS,
     36    #UG_OMIT_MANAGE_FIELDS,
     37    #UG_OMIT_EDIT_FIELDS,
     38    #PUTME_OMIT_DISPLAY_FIELDS,
     39    #PUTME_OMIT_PDF_FIELDS,
     40    #PUTME_OMIT_MANAGE_FIELDS,
     41    #PUTME_OMIT_EDIT_FIELDS,
     42    #PUTME_OMIT_RESULT_SLIP_FIELDS,
     43    #PUDE_OMIT_DISPLAY_FIELDS,
     44    #PUDE_OMIT_PDF_FIELDS,
     45    #PUDE_OMIT_MANAGE_FIELDS,
     46    #PUDE_OMIT_EDIT_FIELDS,
     47    #PUDE_OMIT_RESULT_SLIP_FIELDS,
    4748    )
    4849
     
    5455
    5556from kofacustom.wdu.interfaces import MessageFactory as _
     57
     58
     59# UG students are all undergraduate students.
     60UG_OMIT_DISPLAY_FIELDS = OMIT_DISPLAY_FIELDS
     61UG_OMIT_PDF_FIELDS = UG_OMIT_DISPLAY_FIELDS + ('phone',)
     62UG_OMIT_MANAGE_FIELDS = ('special_application',)
     63UG_OMIT_EDIT_FIELDS = UG_OMIT_MANAGE_FIELDS + OMIT_DISPLAY_FIELDS + (
     64    'student_id', 'notice',
     65    'screening_score',
     66    'screening_venue',
     67    'screening_date',
     68    #'jamb_age',
     69    #'jamb_subjects',
     70    #'jamb_score',
     71    'aggregate')
     72
     73# PUTME is a subgroup of UG with the same interface.
     74PUTME_OMIT_FIELDS = (
     75    'hq_type',
     76    'hq_matric_no',
     77    'hq_degree',
     78    'hq_school',
     79    'hq_session',
     80    'hq_disc',
     81    )
     82PUTME_OMIT_DISPLAY_FIELDS = OMIT_DISPLAY_FIELDS + PUTME_OMIT_FIELDS
     83PUTME_OMIT_MANAGE_FIELDS = UG_OMIT_MANAGE_FIELDS + PUTME_OMIT_FIELDS
     84PUTME_OMIT_EDIT_FIELDS = UG_OMIT_EDIT_FIELDS + PUTME_OMIT_FIELDS + (
     85    #'firstname',
     86    #'middlename',
     87    #'lastname',
     88    #'sex',
     89    #'course1',
     90    #'lga'
     91    )
     92PUTME_OMIT_PDF_FIELDS = PUTME_OMIT_DISPLAY_FIELDS + ('phone',)
     93PUTME_OMIT_RESULT_SLIP_FIELDS = PUTME_OMIT_DISPLAY_FIELDS + (
     94    'phone',
     95    'date_of_birth', 'sex',
     96    'nationality', 'lga', #'perm_address',
     97    'course2', 'screening_venue',
     98    'screening_date')
     99
     100# PUDE is a subgroup of UG with the same interface.
     101PUDE_OMIT_FIELDS = (
     102    'jamb_subjects',
     103    'jamb_score',
     104    'jamb_age',
     105    'aggregate')
     106PUDE_OMIT_DISPLAY_FIELDS = OMIT_DISPLAY_FIELDS + PUDE_OMIT_FIELDS
     107PUDE_OMIT_MANAGE_FIELDS = UG_OMIT_MANAGE_FIELDS + PUDE_OMIT_FIELDS
     108PUDE_OMIT_EDIT_FIELDS = set(UG_OMIT_EDIT_FIELDS + PUDE_OMIT_FIELDS + (
     109    #'firstname',
     110    #'middlename',
     111    #'lastname',
     112    #'sex',
     113    #'course1',
     114    #'lga'
     115    ))
     116PUDE_OMIT_PDF_FIELDS = PUDE_OMIT_DISPLAY_FIELDS + ('phone',)
     117PUDE_OMIT_RESULT_SLIP_FIELDS = PUDE_OMIT_DISPLAY_FIELDS + (
     118    'phone',
     119    'date_of_birth', 'sex',
     120    'nationality', 'lga', #'perm_address',
     121    'course2', 'screening_venue',
     122    'screening_date')
    56123
    57124
  • main/kofacustom.wdu/trunk/src/kofacustom/wdu/applicants/interfaces.py

    r12885 r12887  
    4040from kofacustom.wdu.payments.interfaces import ICustomOnlinePayment
    4141
    42 class ICustomUGApplicant(INigeriaUGApplicant):
     42class ICustomUGApplicant(IApplicantBaseData):
    4343    """An undergraduate applicant.
    4444
     
    4747    adding them to the UG_OMIT* tuples.
    4848    """
     49    sex = schema.Choice(
     50        title = _(u'Sex'),
     51        source = GenderSource(),
     52        required = False,
     53        )
     54    marit_stat = schema.Choice(
     55        title = u'Maritual Status',
     56        required = False,
     57        vocabulary = SimpleKofaVocabulary(
     58            (_('Single'), 'single'),
     59            (_('Married'), 'married'),
     60            (_('Widowed'), 'widowed'),
     61            (_('Divorced'), 'divorced'),
     62            (_('Separated'), 'separated'),)
     63        )
     64    nationality = schema.Choice(
     65        source = nats_vocab,
     66        title = _(u'Nationality'),
     67        required = False,
     68        )
     69    lga = schema.Choice(
     70        source = LGASource(),
     71        title = _(u'State/LGA (Nigerians only)'),
     72        required = False,
     73        )
     74    religion = schema.Choice(
     75        title = u'Religion',
     76        default = 'no_say',
     77        required = False,
     78        vocabulary = SimpleKofaVocabulary(
     79            (_('Muslim'), 'muslim'),
     80            (_('Christian'), 'christian'),
     81            (_('Others'), 'others'),
     82            (_('Prefer not to say'), 'no_say'),)
     83        )
     84    #perm_address = schema.Text(
     85    #    title = _(u'Permanent Address'),
     86    #    required = False,
     87    #    )
     88    next_kin_address = schema.Text(
     89        title = _(u'Next of Kin Address'),
     90        required = False,
     91        )
     92    course1 = schema.Choice(
     93        title = _(u'1st Choice Course of Study'),
     94        source = AppCatCertificateSource(),
     95        required = False,
     96        )
     97    course2 = schema.Choice(
     98        title = _(u'2nd Choice Course of Study'),
     99        source = AppCatCertificateSource(),
     100        required = False,
     101        )
     102    olevel_type = schema.Choice(
     103        title = _(u'Qualification Obtained'),
     104        required = False,
     105        readonly = False,
     106        vocabulary = exam_types,
     107        )
     108    olevel_school = schema.TextLine(
     109        title = _(u'Institution Attended'),
     110        required = False,
     111        readonly = False,
     112        )
     113    olevel_exam_number = schema.TextLine(
     114        title = _(u'Exam Number'),
     115        required = False,
     116        readonly = False,
     117        )
     118    olevel_exam_date = FormattedDate(
     119        title = _(u'Exam Date'),
     120        required = False,
     121        readonly = False,
     122        show_year = True,
     123        )
     124    olevel_results = schema.List(
     125        title = _(u'Exam Results'),
     126        value_type = ResultEntryField(),
     127        required = False,
     128        readonly = False,
     129        default = [],
     130        )
     131    olevel_type2 = schema.Choice(
     132        title = _(u'2nd Qualification Obtained'),
     133        required = False,
     134        readonly = False,
     135        vocabulary = exam_types,
     136        )
     137    olevel_school2 = schema.TextLine(
     138        title = _(u'2nd Institution Attended'),
     139        required = False,
     140        readonly = False,
     141        )
     142    olevel_exam_number2 = schema.TextLine(
     143        title = _(u'2nd Exam Number'),
     144        required = False,
     145        readonly = False,
     146        )
     147    olevel_exam_date2 = FormattedDate(
     148        title = _(u'2nd Exam Date'),
     149        required = False,
     150        readonly = False,
     151        show_year = True,
     152        )
     153    olevel_results2 = schema.List(
     154        title = _(u'2nd Exam Results'),
     155        value_type = ResultEntryField(),
     156        required = False,
     157        readonly = False,
     158        default = [],
     159        )
     160    hq_type = schema.Choice(
     161        title = _(u'Qualification Obtained'),
     162        required = False,
     163        readonly = False,
     164        vocabulary = high_qual,
     165        )
     166    hq_matric_no = schema.TextLine(
     167        title = _(u'Former Matric Number'),
     168        required = False,
     169        readonly = False,
     170        )
     171    hq_degree = schema.Choice(
     172        title = _(u'Class of Degree'),
     173        required = False,
     174        readonly = False,
     175        vocabulary = high_grade,
     176        )
     177    hq_school = schema.TextLine(
     178        title = _(u'Institution Attended'),
     179        required = False,
     180        readonly = False,
     181        )
     182    hq_session = schema.TextLine(
     183        title = _(u'Years Attended'),
     184        required = False,
     185        readonly = False,
     186        )
     187    hq_disc = schema.TextLine(
     188        title = _(u'Discipline'),
     189        required = False,
     190        readonly = False,
     191        )
     192    employer = schema.TextLine(
     193        title = _(u'Employer'),
     194        required = False,
     195        readonly = False,
     196        )
     197    emp_position = schema.TextLine(
     198        title = _(u'Employer Position'),
     199        required = False,
     200        readonly = False,
     201        )
     202    emp_start = FormattedDate(
     203        title = _(u'Start Date'),
     204        required = False,
     205        readonly = False,
     206        show_year = True,
     207        )
     208    emp_end = FormattedDate(
     209        title = _(u'End Date'),
     210        required = False,
     211        readonly = False,
     212        show_year = True,
     213        )
     214    employer2 = schema.TextLine(
     215        title = _(u'2nd Employer'),
     216        required = False,
     217        readonly = False,
     218        )
     219    emp2_position = schema.TextLine(
     220        title = _(u'2nd Employer Position'),
     221        required = False,
     222        readonly = False,
     223        )
     224    emp2_start = FormattedDate(
     225        title = _(u'Start Date'),
     226        required = False,
     227        readonly = False,
     228        show_year = True,
     229        )
     230    emp2_end = FormattedDate(
     231        title = _(u'End Date'),
     232        required = False,
     233        readonly = False,
     234        show_year = True,
     235        )
     236    jamb_subjects = schema.Text(
     237        title = _(u'Subjects and Scores'),
     238        description = _(u'(one subject with score per line)'),
     239        required = False,
     240        )
     241    jamb_score = schema.Int(
     242        title = _(u'Total JAMB Score'),
     243        required = False,
     244        )
     245    jamb_reg_number = schema.TextLine(
     246        title = _(u'JAMB Registration Number'),
     247        required = False,
     248        )
     249    jamb_age = schema.Int(
     250        title = _(u'Age (provided by JAMB)'),
     251        required = False,
     252        )
     253    notice = schema.Text(
     254        title = _(u'Notice'),
     255        required = False,
     256        )
     257    screening_venue = schema.TextLine(
     258        title = _(u'Screening Venue'),
     259        required = False,
     260        )
     261    screening_date = schema.TextLine(
     262        title = _(u'Screening Date'),
     263        required = False,
     264        )
     265    screening_score = schema.Int(
     266        title = _(u'Screening Score (%)'),
     267        required = False,
     268        )
     269    aggregate = schema.Int(
     270        title = _(u'Aggregate Score (%)'),
     271        description = _(u'(average of relative JAMB and PUTME scores)'),
     272        required = False,
     273        )
     274    result_uploaded = schema.Bool(
     275        title = _(u'Result uploaded'),
     276        default = False,
     277        required = False,
     278        )
     279    student_id = schema.TextLine(
     280        title = _(u'Student Id'),
     281        required = False,
     282        readonly = False,
     283        )
     284    course_admitted = schema.Choice(
     285        title = _(u'Admitted Course of Study'),
     286        source = CertificateSource(),
     287        required = False,
     288        )
     289    locked = schema.Bool(
     290        title = _(u'Form locked'),
     291        default = False,
     292        required = False,
     293        )
     294
     295ICustomUGApplicant[
     296    'sex'].order =  IApplicantBaseData['sex'].order
    49297
    50298class ICustomPGApplicant(INigeriaPGApplicant):
     
    76324        """
    77325
    78 class ICustomUGApplicantEdit(INigeriaUGApplicantEdit):
     326class ICustomUGApplicantEdit(ICustomUGApplicant):
    79327    """An undergraduate applicant interface for edit forms.
    80328
     
    105353    """
    106354
    107 class ICustomPUTMEApplicantEdit(IPUTMEApplicantEdit):
     355class ICustomPUTMEApplicantEdit(ICustomUGApplicant):
    108356    """An undergraduate applicant interface for editing.
    109357
  • main/kofacustom.wdu/trunk/src/kofacustom/wdu/applicants/utils.py

    r11940 r12887  
    2929    """A collection of parameters and methods subject to customization.
    3030    """
     31
     32    SEPARATORS_DICT = {
     33        'form.applicant_id': _(u'Base Data'),
     34        'form.course1': _(u'Programmes/Courses Desired'),
     35        'form.olevel_type': _(u'Examinations'),
     36        #'form.olevel_type2': _(u'Second Examination'),
     37        'form.hq_type': _(u'Higher Education Record'),
     38        'form.presently': _(u'Course or Programme Presently Attending'),
     39        'form.nysc_year': _(u'NYSC Information'),
     40        'form.employer': _(u'Employment History'),
     41        'form.jamb_subjects': _(u'JAMB Data'),
     42        'form.notice': _(u'Application Process Information'),
     43        'form.pp_school': _(u'Post Primary School Qualification'),
     44        'form.presently_inst': _(u'Presently attending a course or programme'),
     45        }
Note: See TracChangeset for help on using the changeset viewer.