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/interfaces.py

    r16233 r16249  
    1818
    1919from zope import schema
     20from zope.interface import Attribute, invariant, Invalid
    2021from waeup.kofa.students.vocabularies import StudyLevelSource
    21 from waeup.kofa.interfaces import validate_email
     22from waeup.kofa.interfaces import validate_email, SimpleKofaVocabulary
     23from waeup.kofa.students.interfaces import IStudentPersonal
     24from waeup.kofa.schema import FormattedDate, PhoneNumber
    2225from kofacustom.nigeria.students.interfaces import (
    2326    INigeriaStudentBase, INigeriaUGStudentClearance, INigeriaPGStudentClearance,
     
    5154    'email'].order
    5255
    53 class ICustomStudentPersonal(INigeriaStudentPersonal):
    54     """Student personal data.
    55 
    56     """
     56class ICustomStudentPersonal(IStudentPersonal):
     57    """Student bio data.
     58
     59    """
     60
     61    is_foreigner = Attribute('True if student is non-Nigerian')
     62
     63    perm_address = schema.Text(
     64        title = _(u'Home Address'),
     65        required = False,
     66        )
     67
     68    postal_address = schema.Text(
     69        title = _(u'Postal Address'),
     70        required = False,
     71        )
     72
     73    hostel_address = schema.Text(
     74        title = _(u'Hostel Address'),
     75        required = False,
     76        )
     77
     78    father_address = schema.Text(
     79        title = _(u'Father\'s Address'),
     80        required = False,
     81        )
     82
     83    mother_address = schema.Text(
     84        title = _(u'Mother\'s Address'),
     85        required = False,
     86        )
     87
     88    guardian_address = schema.Text(
     89        title = _(u'Guardian/Sponsor\'s Address'),
     90        required = False,
     91        )
     92
     93    father_phone = PhoneNumber(
     94        title = _(u'Father\'s Mobile Phone Number'),
     95        description = u'',
     96        required = False,
     97        readonly = False,
     98        )
     99
     100    mother_phone = PhoneNumber(
     101        title = _(u'Mother\'s Mobile Phone Number'),
     102        description = u'',
     103        required = False,
     104        readonly = False,
     105        )
     106
     107    guardian_phone = PhoneNumber(
     108        title = _(u'Guardian\'s Mobile Phone Number'),
     109        description = u'',
     110        required = False,
     111        readonly = False,
     112        )
     113
     114    marit_stat = schema.Choice(
     115        title = u'Marital Status',
     116        default = 'unmarried',
     117        required = False,
     118        vocabulary = SimpleKofaVocabulary(
     119            (_('Unmarried'), 'unmarried'),
     120            (_('Married'), 'married'),)
     121        )
     122
     123    religion = schema.Choice(
     124        title = u'Religion',
     125        default = 'no_say',
     126        required = False,
     127        vocabulary = SimpleKofaVocabulary(
     128            (_('Muslim'), 'muslim'),
     129            (_('Christian'), 'christian'),
     130            (_('Others'), 'others'),
     131            (_('Prefer not to say'), 'no_say'),)
     132        )
     133
     134    disabled = schema.Bool(
     135        title = u'Disabled',
     136        default = False,
     137        required = False,
     138        )
     139
     140class ICustomStudentPersonalEdit(ICustomStudentPersonal):
     141    """Interface for editing personal data by students.
     142
     143    Here we can repeat the fields from IStudentPersonal and set the
     144    `required` if necessary.
     145    """
     146
    57147
    58148class ICustomUGStudentClearance(INigeriaUGStudentClearance):
     
    68158
    69159class ICustomStudent(ICustomStudentBase,ICustomUGStudentClearance,
    70     ICustomPGStudentClearance,ICustomStudentPersonal):
     160    ICustomPGStudentClearance, ICustomStudentPersonal):
    71161    """Representation of a student.
    72162
Note: See TracChangeset for help on using the changeset viewer.