Ignore:
Timestamp:
1 May 2013, 06:53:18 (11 years ago)
Author:
Henrik Bettermann
Message:

Customize application forms. KwaraPoly? distinguishes nd and hnd ug applicants. This causes a lot of customization.

File:
1 edited

Legend:

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

    r9347 r10132  
    3131from kofacustom.nigeria.applicants.interfaces import (
    3232    LGASource, high_qual, high_grade, exam_types,
     33    OMIT_DISPLAY_FIELDS,
    3334    INigeriaUGApplicant, INigeriaPGApplicant,
    3435    INigeriaApplicantOnlinePayment,
     
    4041from waeup.kwarapoly.payments.interfaces import ICustomOnlinePayment
    4142
    42 class ICustomUGApplicant(INigeriaUGApplicant):
     43ND_OMIT_DISPLAY_FIELDS = OMIT_DISPLAY_FIELDS + (
     44    'hq_type',
     45    'hq_matric_no',
     46    'hq_degree',
     47    'hq_school',
     48    'hq_session',
     49    'hq_disc',
     50    'hq_type')
     51ND_OMIT_PDF_FIELDS = ND_OMIT_DISPLAY_FIELDS + ('phone',)
     52ND_OMIT_MANAGE_FIELDS = ()
     53ND_OMIT_EDIT_FIELDS = ND_OMIT_MANAGE_FIELDS + ND_OMIT_DISPLAY_FIELDS + (
     54    'student_id', 'notice',
     55    'screening_score',
     56    'screening_venue',
     57    'screening_date',
     58    'jamb_subjects',
     59    'jamb_score',
     60    'aggregate')
     61
     62class ICustomUGApplicant(IApplicantBaseData):
    4363    """An undergraduate applicant.
    4464
     
    4767    adding them to the UG_OMIT* tuples.
    4868    """
     69
     70    nationality = schema.Choice(
     71        source = nats_vocab,
     72        title = _(u'Nationality'),
     73        required = True,
     74        )
     75    lga = schema.Choice(
     76        source = LGASource(),
     77        title = _(u'State/LGA (Nigerians only)'),
     78        required = False,
     79        )
     80    #perm_address = schema.Text(
     81    #    title = _(u'Permanent Address'),
     82    #    required = False,
     83    #    )
     84    next_kin_address = schema.Text(
     85        title = _(u'Next of Kin Address'),
     86        required = False,
     87        )
     88    course1 = schema.Choice(
     89        title = _(u'1st Choice Course of Study'),
     90        source = AppCatCertificateSource(),
     91        required = True,
     92        )
     93    course2 = schema.Choice(
     94        title = _(u'2nd Choice Course of Study'),
     95        source = AppCatCertificateSource(),
     96        required = False,
     97        )
     98    olevel_type = schema.Choice(
     99        title = _(u'Qualification Obtained'),
     100        required = False,
     101        readonly = False,
     102        vocabulary = exam_types,
     103        )
     104    olevel_school = schema.TextLine(
     105        title = _(u'Institution Attended'),
     106        required = False,
     107        readonly = False,
     108        )
     109    olevel_exam_number = schema.TextLine(
     110        title = _(u'Exam Number'),
     111        required = False,
     112        readonly = False,
     113        )
     114    olevel_exam_date = FormattedDate(
     115        title = _(u'Exam Date'),
     116        required = False,
     117        readonly = False,
     118        show_year = True,
     119        )
     120    olevel_results = schema.List(
     121        title = _(u'Exam Results'),
     122        value_type = ResultEntryField(),
     123        required = False,
     124        readonly = False,
     125        default = [],
     126        )
     127    hq_type = schema.Choice(
     128        title = _(u'Qualification Obtained'),
     129        required = False,
     130        readonly = False,
     131        vocabulary = high_qual,
     132        )
     133    hq_matric_no = schema.TextLine(
     134        title = _(u'Former Matric Number'),
     135        required = False,
     136        readonly = False,
     137        )
     138    hq_degree = schema.Choice(
     139        title = _(u'Class of Degree'),
     140        required = False,
     141        readonly = False,
     142        vocabulary = high_grade,
     143        )
     144    hq_school = schema.TextLine(
     145        title = _(u'Institution Attended'),
     146        required = False,
     147        readonly = False,
     148        )
     149    hq_session = schema.TextLine(
     150        title = _(u'Years Attended'),
     151        required = False,
     152        readonly = False,
     153        )
     154    hq_disc = schema.TextLine(
     155        title = _(u'Discipline'),
     156        required = False,
     157        readonly = False,
     158        )
     159    jamb_subjects = schema.Text(
     160        title = _(u'Subjects and Scores'),
     161        required = False,
     162        )
     163    jamb_score = schema.Int(
     164        title = _(u'Total JAMB Score'),
     165        required = False,
     166        )
     167    notice = schema.Text(
     168        title = _(u'Notice'),
     169        required = False,
     170        )
     171    screening_venue = schema.TextLine(
     172        title = _(u'Screening Venue'),
     173        required = False,
     174        )
     175    screening_date = schema.TextLine(
     176        title = _(u'Screening Date'),
     177        required = False,
     178        )
     179    screening_score = schema.Int(
     180        title = _(u'Screening Score (%)'),
     181        required = False,
     182        )
     183    aggregate = schema.Int(
     184        title = _(u'Aggregate Score (%)'),
     185        description = _(u'(average of relative JAMB and PUTME scores)'),
     186        required = False,
     187        )
     188    result_uploaded = schema.Bool(
     189        title = _(u'Result uploaded'),
     190        default = False,
     191        )
     192    student_id = schema.TextLine(
     193        title = _(u'Student Id'),
     194        required = False,
     195        readonly = False,
     196        )
     197    course_admitted = schema.Choice(
     198        title = _(u'Admitted Course of Study'),
     199        source = CertificateSource(),
     200        required = False,
     201        )
     202    locked = schema.Bool(
     203        title = _(u'Form locked'),
     204        default = False,
     205        )
    49206
    50207class ICustomPGApplicant(INigeriaPGApplicant):
     
    75232        """
    76233
    77 class ICustomUGApplicantEdit(INigeriaUGApplicantEdit):
     234class ICustomUGApplicantEdit(ICustomUGApplicant):
    78235    """An undergraduate applicant interface for edit forms.
    79236
     
    104261    """
    105262
    106 class IPUTMEApplicantEdit(IPUTMEApplicantEdit):
    107     """An undergraduate applicant interface for editing.
    108 
    109     Here we can repeat the fields from base data and set the
    110     `required` and `readonly` attributes to True to further restrict
    111     the data access. Or we can allow only certain certificates to be
    112     selected by choosing the appropriate source.
    113 
    114     We cannot omit fields here. This has to be done in the
    115     respective form page.
    116     """
    117 
    118 class ICustomApplicantUpdateByRegNo(INigeriaApplicantUpdateByRegNo):
    119     """Representation of an applicant.
    120 
    121     Skip regular reg_number validation if reg_number is used for finding
    122     the applicant object.
    123     """
    124 
Note: See TracChangeset for help on using the changeset viewer.