Ignore:
Timestamp:
28 Oct 2019, 07:12:20 (5 years ago)
Author:
Henrik Bettermann
Message:

Add email2 field.

Fix tests.

Location:
main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/students
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/students/browser.py

    r15696 r15704  
    3434from kofacustom.nigeria.students.browser import (
    3535    NigeriaOnlinePaymentDisplayFormPage,
     36    NigeriaStudentBaseDisplayFormPage,
    3637    NigeriaStudentBaseManageFormPage,
    3738    NigeriaStudentClearanceEditFormPage,
     
    4041    NigeriaExportPDFClearanceSlip,
    4142    NigeriaExportPDFCourseRegistrationSlip,
     43    NigeriaStudentBaseEditFormPage,
    4244    )
    4345
    4446from kofacustom.iuokada.students.interfaces import (
    4547    ICustomStudentOnlinePayment, ICustomStudentStudyCourse,
    46     ICustomStudentStudyLevel)
     48    ICustomStudentStudyLevel, ICustomStudentBase)
    4749from kofacustom.iuokada.interfaces import MessageFactory as _
     50
     51class CustomStudentBaseDisplayFormPage(NigeriaStudentBaseDisplayFormPage):
     52    """ Page to display student base data
     53    """
     54    form_fields = grok.AutoFields(ICustomStudentBase).omit(
     55        'password', 'suspended', 'suspended_comment', 'flash_notice')
     56
     57class CustomStudentBaseManageFormPage(NigeriaStudentBaseManageFormPage):
     58    """ View to manage student base data
     59    """
     60    form_fields = grok.AutoFields(ICustomStudentBase).omit(
     61        'student_id', 'adm_code', 'suspended')
     62
     63class StudentBaseEditFormPage(NigeriaStudentBaseEditFormPage):
     64    """ View to edit student base data
     65    """
     66    form_fields = grok.AutoFields(ICustomStudentBase).select(
     67        'email', 'email2', 'parents_email', 'phone',)
    4868
    4969class CustomExportPDFCourseRegistrationSlip(
  • main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/students/interfaces.py

    r15563 r15704  
    1919from zope import schema
    2020from waeup.kofa.students.vocabularies import StudyLevelSource
     21from waeup.kofa.interfaces import validate_email
    2122from kofacustom.nigeria.students.interfaces import (
    2223    INigeriaStudentBase, INigeriaUGStudentClearance, INigeriaPGStudentClearance,
     
    3233
    3334    """
     35
     36    email2 = schema.ASCIILine(
     37        title = _(u'Second Email'),
     38        required = False,
     39        constraint=validate_email,
     40        )
     41
     42ICustomStudentBase['email2'].order = ICustomStudentBase[
     43    'phone'].order
     44ICustomStudentBase['phone'].order = ICustomStudentBase[
     45    'email'].order
    3446
    3547class ICustomStudentPersonal(INigeriaStudentPersonal):
  • main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/students/tests/test_export.py

    r15672 r15704  
    4848        self.assertMatches(
    4949            'adm_code,alr_date,alr_fname,alr_no,alr_results,'
    50             'clr_code,date_of_birth,def_adm,disabled,email,emp2_end,'
     50            'clr_code,date_of_birth,def_adm,disabled,email,email2,emp2_end,'
    5151            'emp2_position,emp2_reason,emp2_start,emp_end,emp_position,'
    5252            'emp_reason,emp_start,employer,employer2,'
     
    6767            'current_level,current_session\r\nmy adm code,,,,'
    6868            '"[(\'printing_craft_practice\', \'A1\')]",my clr code,1981-02-04#,,,'
    69             'anna@sample.com,,,,,,,,,,,,,Anna,,,,,,"[(\'printing_craft_practice\', \'A1\')]"'
     69            'anna@sample.com,,,,,,,,,,,,,,Anna,,,,,,"[(\'printing_craft_practice\', \'A1\')]"'
    7070            ',,,,,,,,,,,,,,,,Tester,,,234,M.,NG,,,,,,,,,,'
    7171            '"Studentroad 21\nLagos 123456\n",,+234-123-12345#,,,123,,,,,'
Note: See TracChangeset for help on using the changeset viewer.