Changeset 13545 for main/waeup.aaue


Ignore:
Timestamp:
16 Dec 2015, 08:45:50 (9 years ago)
Author:
Henrik Bettermann
Message:

Add more hq fields.

Re-organize OMIT field structure in views.

Location:
main/waeup.aaue/trunk/src/waeup/aaue/applicants
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.aaue/trunk/src/waeup/aaue/applicants/browser.py

    r13544 r13545  
    3535    NigeriaApplicantRegistrationPage,
    3636    NigeriaExportPDFPaymentSlipPage,
    37     UG_OMIT_DISPLAY_FIELDS,
    38     UG_OMIT_PDF_FIELDS,
    39     UG_OMIT_MANAGE_FIELDS,
    40     UG_OMIT_EDIT_FIELDS)
     37    )
     38from kofacustom.nigeria.applicants.interfaces import OMIT_DISPLAY_FIELDS
    4139from waeup.aaue.applicants.interfaces import (
    4240    ICustomUGApplicant,
     
    4543    )
    4644
    47 UG_OMIT_PDF_FIELDS = tuple([
    48     element for element in UG_OMIT_PDF_FIELDS if not element == 'phone'])
    49 UG_OMIT_PDF_FIELDS += ('reg_number','alr_fname', 'alr_no', 'alr_date',
    50     'alr_results', 'notice')
    51 
    52 FP_OMIT_FIELDS = ('hq_type', 'hq_fname', 'hq_matric_no',
    53      'hq_degree', 'hq_school', 'hq_session', 'hq_disc')
    54 FP_OMIT_DISPLAY_FIELDS = UG_OMIT_DISPLAY_FIELDS + FP_OMIT_FIELDS
    55 FP_OMIT_PDF_FIELDS = UG_OMIT_PDF_FIELDS + FP_OMIT_FIELDS
    56 FP_OMIT_MANAGE_FIELDS = UG_OMIT_MANAGE_FIELDS + FP_OMIT_FIELDS
    57 FP_OMIT_EDIT_FIELDS = UG_OMIT_EDIT_FIELDS + FP_OMIT_FIELDS
    58 
    59 PG_OMIT_FIELDS = ('programme_type',)
    60 PG_OMIT_DISPLAY_FIELDS = UG_OMIT_DISPLAY_FIELDS + PG_OMIT_FIELDS
    61 PG_OMIT_PDF_FIELDS = UG_OMIT_DISPLAY_FIELDS + PG_OMIT_FIELDS
    62 PG_OMIT_MANAGE_FIELDS = UG_OMIT_MANAGE_FIELDS + PG_OMIT_FIELDS
    63 PG_OMIT_EDIT_FIELDS = UG_OMIT_EDIT_FIELDS + PG_OMIT_FIELDS
     45UG_OMIT_FIELDS = (
     46      'hq_type', 'hq_fname', 'hq_matric_no',
     47      'hq_degree', 'hq_school', 'hq_session', 'hq_disc',
     48      'hq_type2', 'hq_fname2', 'hq_matric_no2',
     49      'hq_degree2', 'hq_school2', 'hq_session2', 'hq_disc2',
     50      'hq_type3', 'hq_fname3', 'hq_matric_no3',
     51      'hq_degree3', 'hq_school3', 'hq_session3', 'hq_disc3'
     52      )
     53UG_OMIT_DISPLAY_FIELDS = OMIT_DISPLAY_FIELDS + ('jamb_subjects_list',) + UG_OMIT_FIELDS
     54UG_OMIT_PDF_FIELDS = UG_OMIT_DISPLAY_FIELDS + UG_OMIT_FIELDS + (
     55      'reg_number','alr_fname', 'alr_no', 'alr_date',
     56      'alr_results', 'notice')
     57UG_OMIT_MANAGE_FIELDS = ('special_application','jamb_subjects_list',) + UG_OMIT_FIELDS
     58UG_OMIT_EDIT_FIELDS = UG_OMIT_MANAGE_FIELDS + OMIT_DISPLAY_FIELDS + UG_OMIT_FIELDS + (
     59    'student_id',
     60    'notice',
     61    'screening_score',
     62    'screening_venue',
     63    'screening_date',
     64    'jamb_age',
     65    'jamb_subjects',
     66    'jamb_score',
     67    'jamb_reg_number',
     68    'aggregate')
     69
     70#UG_OMIT_PDF_FIELDS = tuple([
     71#    element for element in UG_OMIT_PDF_FIELDS if not element == 'phone'])
     72
     73#UG_OMIT_PDF_FIELDS += (
     74#      'reg_number','alr_fname', 'alr_no', 'alr_date',
     75#      'alr_results', 'notice'
     76#      )
     77
     78FP_OMIT_DISPLAY_FIELDS = UG_OMIT_DISPLAY_FIELDS + UG_OMIT_FIELDS
     79FP_OMIT_PDF_FIELDS = UG_OMIT_PDF_FIELDS + UG_OMIT_FIELDS
     80FP_OMIT_MANAGE_FIELDS = UG_OMIT_MANAGE_FIELDS + UG_OMIT_FIELDS
     81FP_OMIT_EDIT_FIELDS = UG_OMIT_EDIT_FIELDS + UG_OMIT_FIELDS
     82
     83PG_OMIT_FIELDS = (
     84    'fst_sit_fname',
     85    'fst_sit_no',
     86    'fst_sit_date',
     87    'fst_sit_type',
     88    'fst_sit_results',
     89    'scd_sit_fname',
     90    'scd_sit_no',
     91    'scd_sit_date',
     92    'scd_sit_type',
     93    'scd_sit_results',
     94    'programme_type'
     95    )
     96PG_OMIT_DISPLAY_FIELDS = OMIT_DISPLAY_FIELDS + (
     97    'jamb_subjects_list',) + PG_OMIT_FIELDS
     98PG_OMIT_PDF_FIELDS = PG_OMIT_DISPLAY_FIELDS + PG_OMIT_FIELDS + (
     99      'reg_number','alr_fname', 'alr_no', 'alr_date',
     100      'alr_results', 'notice')
     101PG_OMIT_MANAGE_FIELDS = (
     102    'special_application','jamb_subjects_list',) + PG_OMIT_FIELDS
     103PG_OMIT_EDIT_FIELDS = PG_OMIT_MANAGE_FIELDS + OMIT_DISPLAY_FIELDS + PG_OMIT_FIELDS + (
     104    'student_id',
     105    'notice',
     106    'screening_score',
     107    'screening_venue',
     108    'screening_date',
     109    'jamb_age',
     110    'jamb_subjects',
     111    'jamb_score',
     112    'jamb_reg_number',
     113    'aggregate')
    64114
    65115class CustomApplicantDisplayFormPage(NigeriaApplicantDisplayFormPage):
  • main/waeup.aaue/trunk/src/waeup/aaue/applicants/interfaces.py

    r13544 r13545  
    226226        readonly = False,
    227227        )
     228
     229    hq_type2 = schema.Choice(
     230        title = _(u'Qualification Obtained'),
     231        required = False,
     232        readonly = False,
     233        vocabulary = high_qual,
     234        )
     235
     236    hq_fname2 = schema.TextLine(
     237        title = _(u'Full Name'),
     238        required = False,
     239        readonly = False,
     240        )
     241
     242    hq_matric_no2 = schema.TextLine(
     243        title = _(u'Former Matric Number'),
     244        required = False,
     245        readonly = False,
     246        )
     247
     248    hq_degree2 = schema.Choice(
     249        title = _(u'Class of Degree'),
     250        required = False,
     251        readonly = False,
     252        vocabulary = high_grade,
     253        )
     254
     255    hq_school2 = schema.TextLine(
     256        title = _(u'Institution Attended'),
     257        required = False,
     258        readonly = False,
     259        )
     260
     261    hq_session2 = schema.TextLine(
     262        title = _(u'Years Attended'),
     263        required = False,
     264        readonly = False,
     265        )
     266
     267    hq_disc2 = schema.TextLine(
     268        title = _(u'Discipline'),
     269        required = False,
     270        readonly = False,
     271        )
     272
     273    hq_type3 = schema.Choice(
     274        title = _(u'Qualification Obtained'),
     275        required = False,
     276        readonly = False,
     277        vocabulary = high_qual,
     278        )
     279
     280    hq_fname3 = schema.TextLine(
     281        title = _(u'Full Name'),
     282        required = False,
     283        readonly = False,
     284        )
     285
     286    hq_matric_no3 = schema.TextLine(
     287        title = _(u'Former Matric Number'),
     288        required = False,
     289        readonly = False,
     290        )
     291
     292    hq_degree3 = schema.Choice(
     293        title = _(u'Class of Degree'),
     294        required = False,
     295        readonly = False,
     296        vocabulary = high_grade,
     297        )
     298
     299    hq_school3 = schema.TextLine(
     300        title = _(u'Institution Attended'),
     301        required = False,
     302        readonly = False,
     303        )
     304
     305    hq_session3 = schema.TextLine(
     306        title = _(u'Years Attended'),
     307        required = False,
     308        readonly = False,
     309        )
     310
     311    hq_disc3 = schema.TextLine(
     312        title = _(u'Discipline'),
     313        required = False,
     314        readonly = False,
     315        )
    228316    notice = schema.Text(
    229317        title = _(u'Notice'),
     
    421509
    422510class ICustomApplicant(ICustomUGApplicant, ICustomPGApplicant,
    423     ITranscriptApplicant):
     511                       ITranscriptApplicant):
    424512    """An interface for all three types of applicants.
    425513
  • main/waeup.aaue/trunk/src/waeup/aaue/applicants/tests/test_applicantcopier.py

    r13368 r13545  
    6161        self.browser.getControl(name="form.alr_fname").value = 'Uli'
    6262        self.browser.getControl(name="form.alr_no").value = '345'
    63         self.browser.getControl(name="form.hq_type").value = ['nce']
    64         self.browser.getControl(name="form.hq_fname").value = 'Beate'
    65         self.browser.getControl(name="form.hq_matric_no").value = '444'
    66         self.browser.getControl(name="form.hq_degree").value = ['upper_credit']
    67         self.browser.getControl(name="form.hq_school").value = 'my school'
    68         self.browser.getControl(name="form.hq_session").value = '2011/12'
    69         self.browser.getControl(name="form.hq_disc").value = 'funny sport'
    7063
    7164        self.browser.getControl("Save").click()
     
    8477        self.assertEqual(student.alr_fname, 'Uli')
    8578        self.assertEqual(student.alr_no, '345')
    86         self.assertEqual(student.hq_type, 'nce')
    87         self.assertEqual(student.hq_fname, 'Beate')
    88         self.assertEqual(student.hq_matric_no, '444')
    89         self.assertEqual(student.hq_degree, 'upper_credit')
    90         self.assertEqual(student.hq_school, 'my school')
    91         self.assertEqual(student.hq_session, '2011/12')
    92         self.assertEqual(student.hq_disc, 'funny sport')
  • main/waeup.aaue/trunk/src/waeup/aaue/applicants/tests/test_browser.py

    r13544 r13545  
    9797        self.assertEqual(self.browser.headers['Status'], '200 Ok')
    9898        self.assertTrue("Dispatch Address" in self.browser.contents)
     99
     100    def test_pg_application_manage(self):
     101        # Add pg applicants container
     102        self.pgcontainer = ApplicantsContainer()
     103        self.pgcontainer.mode = 'create'
     104        self.pgcontainer.code = u'pgft%s' % session_1
     105        self.pgcontainer.prefix = u'pgft'
     106        self.pgcontainer.application_category = u'no'
     107        self.pgcontainer.year = session_1
     108        self.pgcontainer.application_fee = 300.0
     109        self.pgcontainer.title = u'This is the pgft%s container' % session_1
     110        self.app['applicants'][self.pgcontainer.code] = self.pgcontainer
     111        delta = datetime.timedelta(days=10)
     112        self.pgcontainer.startdate = datetime.datetime.now(pytz.utc) - delta
     113        self.pgcontainer.enddate = datetime.datetime.now(pytz.utc) + delta
     114        # Add applicant
     115        pgapplicant = createObject(u'waeup.Applicant')
     116        pgapplicant.firstname = u'Anna'
     117        pgapplicant.lastname = u'Post'
     118        self.app['applicants'][self.pgcontainer.code].addApplicant(pgapplicant)
     119        self.pgapplication_number = pgapplicant.application_number
     120        self.pgapplicant = self.app['applicants'][self.pgcontainer.code][
     121            self.pgapplication_number]
     122        self.pgapplicant_path = ('http://localhost/app/applicants/pgft%s/%s'
     123            % (session_1, self.pgapplication_number))
     124        self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
     125        self.browser.open(self.pgapplicant_path)
     126        self.assertEqual(self.browser.headers['Status'], '200 Ok')
     127        self.assertTrue("3rd Higher Education Record" in self.browser.contents)
  • main/waeup.aaue/trunk/src/waeup/aaue/applicants/utils.py

    r13538 r13545  
    3939        'form.applicant_id': _(u'Base Data'),
    4040        #'form.course1': _(u'Programmes/Courses Desired'),
    41         'form.hq_type': _(u'Higher Education Record'),
     41       'form.fst_sit_fname': _(u'1st Sitting'),
     42        'form.scd_sit_fname': _(u'2nd Sitting'),
     43        'form.alr_fname': _(u'Advanced Level Record'),
     44        'form.hq_type': _(u'1st Higher Education Record'),
     45        'form.hq_type2': _(u'2nd Higher Education Record'),
     46        'form.hq_type3': _(u'3rd Higher Education Record'),
    4247        'form.presently': _(u'Course or Programme Presently Attending'),
    4348        'form.nysc_year': _(u'NYSC Information'),
     
    4853        'form.presently_inst': _(u'Presently attending a course or programme'),
    4954        'form.olevel_type': _(u"'O' Level Records"),
    50         'form.fst_sit_fname': _(u'1st Sitting'),
    51         'form.scd_sit_fname': _(u'2nd Sitting'),
    52         'form.alr_fname': _(u'Advanced Level Record'),
     55
    5356        }
    5457
Note: See TracChangeset for help on using the changeset viewer.