Ignore:
Timestamp:
21 Jun 2015, 11:47:55 (9 years ago)
Author:
Henrik Bettermann
Message:

Allow students to edit parent_email.

Location:
main/waeup.uniben/trunk/src/waeup/uniben/students
Files:
4 edited

Legend:

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

    r13063 r13085  
    4646    NigeriaExportPDFClearanceSlip,
    4747    NigeriaStudentPersonalDisplayFormPage,
    48     NigeriaStudentPersonalManageFormPage
     48    NigeriaStudentPersonalManageFormPage,
     49    NigeriaStudentPersonalEditFormPage
    4950    )
    5051
     
    5657    ICustomUGStudentClearance,
    5758    ICustomPGStudentClearance,
    58     ICustomStudentPersonal)
     59    ICustomStudentPersonal,
     60    ICustomStudentPersonalEdit)
    5961from waeup.uniben.interfaces import MessageFactory as _
    6062
     
    229231    form_fields[
    230232        'personal_updated'].custom_widget = FriendlyDatetimeDisplayWidget('le')
     233
     234class CstomStudentPersonalEditFormPage(NigeriaStudentPersonalEditFormPage):
     235    """ Page to edit personal data
     236    """
     237    form_fields = grok.AutoFields(
     238        ICustomStudentPersonalEdit).omit('personal_updated')
    231239
    232240class StudyCourseCOEditFormPage(KofaEditFormPage):
  • main/waeup.uniben/trunk/src/waeup/uniben/students/interfaces.py

    r12856 r13085  
    2121from kofacustom.nigeria.students.interfaces import (
    2222    INigeriaStudentBase, INigeriaUGStudentClearance, INigeriaPGStudentClearance,
    23     INigeriaStudentPersonal, INigeriaStudentStudyLevel,
     23    INigeriaStudentPersonal, INigeriaStudentPersonalEdit,
     24    INigeriaStudentStudyLevel,
    2425    INigeriaStudentStudyCourse, INigeriaCourseTicket,
    2526    INigeriaStudentUpdateByRegNo, INigeriaStudentUpdateByMatricNo,
     
    3031class ICustomStudentBase(INigeriaStudentBase):
    3132    """Representation of student base data.
    32 
    3333    """
    3434
    3535class ICustomStudentPersonal(INigeriaStudentPersonal):
    3636    """Student personal data.
     37    """
    3738
     39    parent_email = schema.ASCIILine(
     40        title = _(u'Parent Email'),
     41        required = False,
     42        constraint=validate_email,
     43        )
     44
     45class ICustomStudentPersonalEdit(INigeriaStudentPersonalEdit):
     46    """Interface for editing personal data by students.
    3847    """
    3948
     
    4655class ICustomUGStudentClearance(INigeriaUGStudentClearance):
    4756    """Representation of ug student clearance data.
    48 
    4957    """
    5058
    5159class ICustomPGStudentClearance(INigeriaPGStudentClearance):
    5260    """Representation of pg student clearance data.
    53 
    5461    """
    55 
    5662
    5763class ICustomStudent(ICustomStudentBase, ICustomUGStudentClearance,
    5864    ICustomPGStudentClearance, ICustomStudentPersonal):
    5965    """Representation of a student.
    60 
    6166    """
    6267
    6368class ICustomStudentStudyCourse(INigeriaStudentStudyCourse):
    6469    """A container for student study levels.
    65 
    6670    """
    6771
    6872class ICustomStudentStudyLevel(INigeriaStudentStudyLevel):
    6973    """A container for course tickets.
    70 
    7174    """
    7275
     
    9497class ICustomCourseTicket(INigeriaCourseTicket):
    9598    """A course ticket.
    96 
    9799    """
    98100
    99101class ICustomStudentUpdateByRegNo(INigeriaStudentUpdateByRegNo):
    100102    """Representation of a student. Skip regular reg_number validation.
    101 
    102103    """
    103104
    104105class ICustomStudentUpdateByMatricNo(INigeriaStudentUpdateByMatricNo):
    105106    """Representation of a student. Skip regular matric_number validation.
    106 
    107107    """
  • main/waeup.uniben/trunk/src/waeup/uniben/students/student.py

    r12845 r13085  
    2626from waeup.kofa.utils.helpers import get_current_principal
    2727from kofacustom.nigeria.students.student import NigeriaStudent
    28 from waeup.uniben.students.interfaces import ICustomStudent
     28from waeup.uniben.students.interfaces import (
     29    ICustomStudent, ICustomStudentPersonalEdit)
    2930
    3031
     
    3334    owned by students.
    3435    """
    35     grok.implements(ICustomStudent, IStudentNavigation)
     36    grok.implements(
     37        ICustomStudent, IStudentNavigation, ICustomStudentPersonalEdit)
    3638    grok.provides(ICustomStudent)
    3739
  • main/waeup.uniben/trunk/src/waeup/uniben/students/tests/test_browser.py

    r13063 r13085  
    195195        open(path, 'wb').write(self.browser.contents)
    196196        print "Sample PDF clearance_invitation_slip.pdf written to %s" % path
     197        # Students can open the personal edit page and see the parent_email field.
     198        self.browser.open(self.student_path + '/edit_personal')
     199        self.assertTrue('parent_email' in self.browser.contents)
    197200
    198201    def test_manage_payments(self):
Note: See TracChangeset for help on using the changeset viewer.