Ignore:
Timestamp:
28 Sep 2020, 17:37:18 (4 years ago)
Author:
Henrik Bettermann
Message:

Customite personal data form.

File:
1 edited

Legend:

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

    r16241 r16249  
    2121from zope.schema.interfaces import ConstraintNotSatisfied
    2222from zope.component import getUtility
     23from zope.formlib.textwidgets import BytesDisplayWidget
    2324from hurry.workflow.interfaces import IWorkflowInfo
    2425from waeup.kofa.interfaces import (REQUESTED, IExtFileStore, IKofaUtils,
     
    5152    NigeriaAccommodationManageFormPage,
    5253    NigeriaAccommodationDisplayFormPage,
     54    NigeriaStudentPersonalManageFormPage,
     55    NigeriaStudentPersonalEditFormPage,
     56    NigeriaStudentPersonalDisplayFormPage
    5357    )
    54 
    5558from kofacustom.iuokada.students.interfaces import (
    5659    ICustomStudentOnlinePayment, ICustomStudentStudyCourse,
    57     ICustomStudentStudyLevel, ICustomStudentBase, ICustomStudent)
     60    ICustomStudentStudyLevel, ICustomStudentBase, ICustomStudent,
     61    ICustomStudentPersonal, ICustomStudentPersonalEdit)
    5862from kofacustom.iuokada.interfaces import MessageFactory as _
    5963
     
    97101    #            )
    98102    #    return ()
     103
     104class CustomStudentPersonalDisplayFormPage(NigeriaStudentPersonalDisplayFormPage):
     105    """ Page to display student personal data
     106    """
     107    form_fields = grok.AutoFields(ICustomStudentPersonal)
     108    form_fields['perm_address'].custom_widget = BytesDisplayWidget
     109    form_fields['postal_address'].custom_widget = BytesDisplayWidget
     110    form_fields['hostel_address'].custom_widget = BytesDisplayWidget
     111    form_fields['father_address'].custom_widget = BytesDisplayWidget
     112    form_fields['mother_address'].custom_widget = BytesDisplayWidget
     113    form_fields['guardian_address'].custom_widget = BytesDisplayWidget
     114    form_fields[
     115        'personal_updated'].custom_widget = FriendlyDatetimeDisplayWidget('le')
     116
     117
     118class CustomStudentPersonalEditFormPage(NigeriaStudentPersonalEditFormPage):
     119    """ Page to edit personal data
     120    """
     121    form_fields = grok.AutoFields(ICustomStudentPersonalEdit).omit('personal_updated')
     122
     123class CustomStudentPersonalManageFormPage(NigeriaStudentPersonalManageFormPage):
     124    """ Page to edit personal data
     125    """
     126    form_fields = grok.AutoFields(ICustomStudentPersonal)
     127    form_fields['personal_updated'].for_display = True
     128    form_fields[
     129        'personal_updated'].custom_widget = FriendlyDatetimeDisplayWidget('le')
    99130
    100131class CustomAccommodationDisplayFormPage(NigeriaAccommodationDisplayFormPage):
Note: See TracChangeset for help on using the changeset viewer.