Ignore:
Timestamp:
23 Nov 2013, 08:24:15 (11 years ago)
Author:
Henrik Bettermann
Message:

Customize applicant interfaces and browser components.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/kofacustom.ekodisco/trunk/src/kofacustom/ekodisco/applicants/interfaces.py

    r10770 r10794  
    2828from waeup.kofa.schema import FormattedDate, TextLineChoice
    2929from waeup.kofa.students.vocabularies import nats_vocab, GenderSource
    30 from waeup.kofa.applicants.interfaces import contextual_reg_num_source
     30from waeup.kofa.applicants.interfaces import (
     31    contextual_reg_num_source,
     32    IApplicant, IApplicantEdit, IApplicantUpdateByRegNo)
    3133from kofacustom.nigeria.applicants.interfaces import (
    3234    LGASource, high_qual, high_grade, exam_types,
    33     INigeriaUGApplicant, INigeriaPGApplicant,
    3435    INigeriaApplicantOnlinePayment,
    35     INigeriaUGApplicantEdit, INigeriaPGApplicantEdit,
    36     INigeriaApplicantUpdateByRegNo,
    37     IPUTMEApplicantEdit,
    3836    )
    3937from kofacustom.ekodisco.interfaces import MessageFactory as _
    4038from kofacustom.ekodisco.payments.interfaces import ICustomOnlinePayment
    4139
    42 class ICustomUGApplicant(INigeriaUGApplicant):
    43     """An undergraduate applicant.
     40class ICustomApplicant(IApplicant):
     41    """An applicant.
    4442
    45     This interface defines the least common multiple of all fields
    46     in ug application forms. In customized forms, fields can be excluded by
    47     adding them to the UG_OMIT* tuples.
    4843    """
    4944
    50 class ICustomPGApplicant(INigeriaPGApplicant):
    51     """A postgraduate applicant.
     45    course1 = schema.Choice(
     46        title = _(u'Desired Contract'),
     47        source = AppCatCertificateSource(),
     48        required = False,
     49        )
     50    course2 = schema.Choice(
     51        title = _(u'Not applicable'),
     52        source = AppCatCertificateSource(),
     53        required = False,
     54        )
     55    course_admitted = schema.Choice(
     56        title = _(u'Assigned Contract'),
     57        source = CertificateSource(),
     58        required = False,
     59        readonly = False,
     60        )
     61    perm_address = schema.Text(
     62        title = _(u'Customer Address'),
     63        required = False,
     64        )
     65    service_address = schema.Text(
     66        title = _(u'Service Address'),
     67        required = False,
     68        )
    5269
    53     This interface defines the least common multiple of all fields
    54     in pg application forms. In customized forms, fields can be excluded by
    55     adding them to the PG_OMIT* tuples.
    56     """
    57 
    58 
    59 class ICustomApplicant(ICustomUGApplicant, ICustomPGApplicant):
    60     """An interface for both types of applicants.
    61 
    62     Attention: The ICustomPGApplicant field seetings will be overwritten
    63     by ICustomPGApplicant field settings. If a field is defined
    64     in both interfaces zope.schema validates only against the
    65     constraints in ICustomUGApplicant. This does not affect the forms
    66     since they are build on either ICustomUGApplicant or ICustomPGApplicant.
    67     """
    68 
    69     def writeLogMessage(view, comment):
    70         """Adds an INFO message to the log file
    71         """
    72 
    73     def createStudent():
    74         """Create a student object from applicant data
    75         and copy applicant object.
    76         """
    77 
    78 class ICustomUGApplicantEdit(INigeriaUGApplicantEdit):
    79     """An undergraduate applicant interface for edit forms.
     70class ICustomApplicantEdit(IApplicantEdit):
     71    """An applicant interface for edit forms.
    8072
    8173    Here we can repeat the fields from base data and set the
     
    8880    """
    8981
    90 class ICustomPGApplicantEdit(INigeriaPGApplicantEdit):
    91     """A postgraduate applicant interface for editing.
    92 
    93     Here we can repeat the fields from base data and set the
    94     `required` and `readonly` attributes to True to further restrict
    95     the data access. Or we can allow only certain certificates to be
    96     selected by choosing the appropriate source.
    97 
    98     We cannot omit fields here. This has to be done in the
    99     respective form page.
    100     """
     82    course1 = schema.Choice(
     83        title = _(u'Desired Contract'),
     84        source = AppCatCertificateSource(),
     85        required = True,
     86        )
     87    course2 = schema.Choice(
     88        title = _(u'Not applicable'),
     89        source = AppCatCertificateSource(),
     90        required = False,
     91        )
     92    course_admitted = schema.Choice(
     93        title = _(u'Assigned Contract'),
     94        source = CertificateSource(),
     95        required = False,
     96        readonly = True,
     97        )
     98    perm_address = schema.Text(
     99        title = _(u'Customer Address'),
     100        required = True,
     101        )
     102    service_address = schema.Text(
     103        title = _(u'Service Address'),
     104        required = True,
     105        )
    101106
    102107class ICustomApplicantOnlinePayment(INigeriaApplicantOnlinePayment):
     
    105110    """
    106111
    107 class IPUTMEApplicantEdit(IPUTMEApplicantEdit):
    108     """An undergraduate applicant interface for editing.
    109 
    110     Here we can repeat the fields from base data and set the
    111     `required` and `readonly` attributes to True to further restrict
    112     the data access. Or we can allow only certain certificates to be
    113     selected by choosing the appropriate source.
    114 
    115     We cannot omit fields here. This has to be done in the
    116     respective form page.
    117     """
    118 
    119 class ICustomApplicantUpdateByRegNo(INigeriaApplicantUpdateByRegNo):
     112class ICustomApplicantUpdateByRegNo(IApplicantUpdateByRegNo):
    120113    """Representation of an applicant.
    121114
Note: See TracChangeset for help on using the changeset viewer.