Ignore:
Timestamp:
17 Aug 2016, 05:59:38 (8 years ago)
Author:
Henrik Bettermann
Message:

Add sc_pin and sc_serial_number fields and customize all views.

Location:
main/waeup.aaue/trunk/src/waeup/aaue/students
Files:
3 edited

Legend:

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

    r14068 r14084  
    5353    NigeriaExportPDFPaymentSlip,
    5454    NigeriaExportPDFCourseRegistrationSlip,
    55     NigeriaExportPDFClearanceSlip,
    5655    NigeriaStudentPersonalDisplayFormPage,
    5756    NigeriaStudentPersonalEditFormPage,
    5857    NigeriaStudentPersonalManageFormPage,
     58    NigeriaStudentClearanceDisplayFormPage,
     59    NigeriaExportPDFClearanceSlip,
     60    NigeriaStudentClearanceManageFormPage,
    5961    NigeriaStudentClearanceEditFormPage,
    6062    NigeriaAccommodationManageFormPage,
     
    6971    ICustomStudentPersonalEdit,
    7072    ICustomUGStudentClearance,
     73    ICustomPGStudentClearance,
    7174    ICustomCourseTicket,
    7275    ICustomStudentBase)
     
    112115    form_fields[
    113116        'personal_updated'].custom_widget = FriendlyDatetimeDisplayWidget('le')
     117
     118class CustomStudentClearanceDisplayFormPage(NigeriaStudentClearanceDisplayFormPage):
     119    """ Page to display student clearance data
     120    """
     121
     122    @property
     123    def form_fields(self):
     124        if self.context.is_postgrad:
     125            form_fields = grok.AutoFields(
     126                ICustomPGStudentClearance).omit('clearance_locked')
     127        else:
     128            form_fields = grok.AutoFields(
     129                ICustomUGStudentClearance).omit('clearance_locked')
     130        if not getattr(self.context, 'officer_comment'):
     131            form_fields = form_fields.omit('officer_comment')
     132        else:
     133            form_fields['officer_comment'].custom_widget = BytesDisplayWidget
     134        return form_fields
     135
     136class CustomStudentClearanceManageFormPage(NigeriaStudentClearanceManageFormPage):
     137    """ Page to edit student clearance data
     138    """
     139
     140    @property
     141    def form_fields(self):
     142        if self.context.is_postgrad:
     143            form_fields = grok.AutoFields(
     144                ICustomPGStudentClearance).omit('clr_code')
     145        else:
     146            form_fields = grok.AutoFields(
     147                ICustomUGStudentClearance).omit('clr_code')
     148        return form_fields
    114149
    115150class CustomStudentClearanceEditFormPage(NigeriaStudentClearanceEditFormPage):
     
    435470            target_language=portal_language) \
    436471            + ' %s' % self.context.display_fullname
     472
     473    @property
     474    def form_fields(self):
     475        if self.context.is_postgrad:
     476            form_fields = grok.AutoFields(
     477                ICustomPGStudentClearance).omit('clearance_locked')
     478        else:
     479            form_fields = grok.AutoFields(
     480                ICustomUGStudentClearance).omit('clearance_locked')
     481        if not getattr(self.context, 'officer_comment'):
     482            form_fields = form_fields.omit('officer_comment')
     483        return form_fields
    437484
    438485class StudentGetMatricNumberPage(UtilityView, grok.View):
  • main/waeup.aaue/trunk/src/waeup/aaue/students/interfaces.py

    r13865 r14084  
    230230        )
    231231
     232    sc_pin = schema.TextLine(
     233        title = _(u'Scratch Card Pin'),
     234        required = False,
     235        readonly = False,
     236        )
     237
     238    sc_serial_number = schema.TextLine(
     239        title = _(u'Scratch Card Serial Number'),
     240        required = False,
     241        readonly = False,
     242        )
     243
    232244ICustomUGStudentClearance['lga'].order = INigeriaUGStudentClearance[
    233245    'lga'].order
    234246#ICustomUGStudentClearance['date_of_birth'].order = INigeriaUGStudentClearance[
    235247#    'date_of_birth'].order
     248ICustomUGStudentClearance['sc_pin'].order = INigeriaUGStudentClearance[
     249    'fst_sit_fname'].order
     250ICustomUGStudentClearance['sc_serial_number'].order = ICustomUGStudentClearance[
     251    'fst_sit_fname'].order
    236252
    237253
  • main/waeup.aaue/trunk/src/waeup/aaue/students/tests/test_export.py

    r13963 r14084  
    6565            'nysc_year,officer_comment,perm_address,personal_updated,'
    6666            'phone,phone_personal,physical_clearance_date,reg_number,'
    67             'religion,scd_sit_date,scd_sit_fname,scd_sit_no,scd_sit_results,'
     67            'religion,sc_pin,sc_serial_number,scd_sit_date,'
     68            'scd_sit_fname,scd_sit_no,scd_sit_results,'
    6869            'scd_sit_type,sex,student_id,suspended,suspended_comment,password,'
    6970            'state,history,certcode,is_postgrad,current_level,current_session'
     
    7374            '"[(\'printing_craft_practice\', \'A1\')]",,,,,,,,,,,,,,,,Tester,,,'
    7475            '234,M.,,,,,NG,,,,,,,,,"Studentroad 21\nLagos 123456\n",,'
    75             '+234-123-12345#,,,123,,,,,'
     76            '+234-123-12345#,,,123,,,,,,,'
    7677            '"[(\'printing_craft_practice\', \'A1\')]",,f,A111111,0,,,'
    7778            'created,[u\'2015-10-26 17:45:56 WAT - Record created by system\'],'
Note: See TracChangeset for help on using the changeset viewer.