Ignore:
Timestamp:
29 Oct 2015, 22:05:33 (9 years ago)
Author:
Henrik Bettermann
Message:

Make lga and date_of_birth fields required.

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

Legend:

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

    r13360 r13362  
    4343    NigeriaStudentPersonalEditFormPage,
    4444    NigeriaStudentPersonalManageFormPage,
     45    NigeriaStudentClearanceEditFormPage,
    4546    )
    4647from waeup.aaue.students.interfaces import (
     
    4950    ICustomStudent,
    5051    ICustomStudentPersonal,
    51     ICustomStudentPersonalEdit)
     52    ICustomStudentPersonalEdit,
     53    ICustomUGStudentClearance)
    5254from waeup.aaue.interfaces import MessageFactory as _
    5355
     
    7577    form_fields[
    7678        'personal_updated'].custom_widget = FriendlyDatetimeDisplayWidget('le')
     79
     80class CustomStudentClearanceEditFormPage(NigeriaStudentClearanceEditFormPage):
     81    """ View to edit student clearance data by student
     82    """
     83
     84    @property
     85    def form_fields(self):
     86        if self.context.is_postgrad:
     87            form_fields = grok.AutoFields(ICustomPGStudentClearance).omit(
     88            'clearance_locked', 'nysc_location', 'clr_code', 'officer_comment',
     89            'physical_clearance_date')
     90        else:
     91            form_fields = grok.AutoFields(ICustomUGStudentClearance).omit(
     92            'clearance_locked', 'clr_code', 'officer_comment',
     93            'physical_clearance_date')
     94        return form_fields
    7795
    7896class CustomStartClearancePage(StartClearancePage):
  • main/waeup.aaue/trunk/src/waeup/aaue/students/interfaces.py

    r13351 r13362  
    2222from zope.component import getUtility
    2323from waeup.kofa.interfaces import IKofaObject
    24 from waeup.kofa.schema import PhoneNumber
     24from waeup.kofa.schema import PhoneNumber, FormattedDate
     25from kofacustom.nigeria.interfaces import LGASource
    2526from kofacustom.nigeria.students.interfaces import (
    2627    INigeriaStudentBase, INigeriaUGStudentClearance, INigeriaPGStudentClearance,
     
    194195    """
    195196
     197    date_of_birth = FormattedDate(
     198        title = _(u'Date of Birth'),
     199        required = True,
     200        show_year = True,
     201        )
     202
     203    lga = schema.Choice(
     204        source = LGASource(),
     205        title = _(u'State / LGA'),
     206        required = True,
     207        )
     208
     209ICustomUGStudentClearance['lga'].order = INigeriaUGStudentClearance[
     210    'lga'].order
     211ICustomUGStudentClearance['date_of_birth'].order = INigeriaUGStudentClearance[
     212    'date_of_birth'].order
     213
     214
    196215class ICustomPGStudentClearance(INigeriaPGStudentClearance):
    197216    """Representation of pg student clearance data.
Note: See TracChangeset for help on using the changeset viewer.