Ignore:
Timestamp:
14 Apr 2015, 12:01:57 (10 years ago)
Author:
Henrik Bettermann
Message:

Add parent_email. This field is only editable by managers.

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

Legend:

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

    r12855 r12856  
    1919from zope.i18n import translate
    2020from zope.schema.interfaces import ConstraintNotSatisfied
     21from zope.formlib.textwidgets import BytesDisplayWidget
    2122from zope.component import getUtility
    2223from hurry.workflow.interfaces import IWorkflowInfo
     
    4445    NigeriaExportPDFPaymentSlipPage,
    4546    NigeriaExportPDFClearanceSlipPage,
     47    NigeriaStudentPersonalDisplayFormPage,
     48    NigeriaStudentPersonalManageFormPage
    4649    )
    4750
    4851from waeup.uniben.students.interfaces import (
    4952    ICustomStudent,
    50     ICustomStudentOnlinePayment, ICustomStudentStudyCourse,
     53    ICustomStudentOnlinePayment,
     54    ICustomStudentStudyCourse,
    5155    ICustomStudentStudyLevel,
    5256    ICustomUGStudentClearance,
    53     ICustomPGStudentClearance)
     57    ICustomPGStudentClearance,
     58    ICustomStudentPersonal)
    5459from waeup.uniben.interfaces import MessageFactory as _
    5560
     
    203208            omit_fields=self.omit_fields,
    204209            note=self.note)
     210
     211class CustomStudentPersonalDisplayFormPage(
     212    NigeriaStudentPersonalDisplayFormPage):
     213    """ Page to display student personal data
     214    """
     215
     216    form_fields = grok.AutoFields(ICustomStudentPersonal)
     217    form_fields['perm_address'].custom_widget = BytesDisplayWidget
     218    form_fields['next_kin_address'].custom_widget = BytesDisplayWidget
     219    form_fields[
     220        'personal_updated'].custom_widget = FriendlyDatetimeDisplayWidget('le')
     221
     222class CustomStudentPersonalManageFormPage(
     223    NigeriaStudentPersonalManageFormPage):
     224    """ Page to manage personal data
     225    """
     226
     227    form_fields = grok.AutoFields(ICustomStudentPersonal)
     228    form_fields['personal_updated'].for_display = True
     229    form_fields[
     230        'personal_updated'].custom_widget = FriendlyDatetimeDisplayWidget('le')
    205231
    206232class StudyCourseCOEditFormPage(KofaEditFormPage):
  • main/waeup.uniben/trunk/src/waeup/uniben/students/interfaces.py

    r9540 r12856  
    1818
    1919from zope import schema
     20from waeup.kofa.interfaces import validate_email
    2021from kofacustom.nigeria.students.interfaces import (
    2122    INigeriaStudentBase, INigeriaUGStudentClearance, INigeriaPGStudentClearance,
     
    3738    """
    3839
     40    parent_email = schema.ASCIILine(
     41        title = _(u'Parent Email'),
     42        required = False,
     43        constraint=validate_email,
     44        )
     45
    3946class ICustomUGStudentClearance(INigeriaUGStudentClearance):
    4047    """Representation of ug student clearance data.
     
    4855
    4956
    50 class ICustomStudent(ICustomStudentBase,ICustomUGStudentClearance,
    51     ICustomPGStudentClearance,ICustomStudentPersonal):
     57class ICustomStudent(ICustomStudentBase, ICustomUGStudentClearance,
     58    ICustomPGStudentClearance, ICustomStudentPersonal):
    5259    """Representation of a student.
    5360
Note: See TracChangeset for help on using the changeset viewer.