source: main/kofacustom.ekodisco/branches/0.1/src/kofacustom/ekodisco/applicants/interfaces.py @ 17364

Last change on this file since 17364 was 10794, checked in by Henrik Bettermann, 11 years ago

Customize applicant interfaces and browser components.

  • Property svn:keywords set to Id
File size: 3.8 KB
Line 
1## $Id: interfaces.py 10794 2013-11-23 08:24:15Z henrik $
2##
3## Copyright (C) 2011 Uli Fouquet & Henrik Bettermann
4## This program is free software; you can redistribute it and/or modify
5## it under the terms of the GNU General Public License as published by
6## the Free Software Foundation; either version 2 of the License, or
7## (at your option) any later version.
8##
9## This program is distributed in the hope that it will be useful,
10## but WITHOUT ANY WARRANTY; without even the implied warranty of
11## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12## GNU General Public License for more details.
13##
14## You should have received a copy of the GNU General Public License
15## along with this program; if not, write to the Free Software
16## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17##
18"""Customized interfaces of the university application package.
19"""
20
21from zope import schema
22from waeup.kofa.applicants.interfaces import (
23    IApplicantBaseData,
24    AppCatCertificateSource, CertificateSource)
25from waeup.kofa.schoolgrades import ResultEntryField
26from waeup.kofa.interfaces import (
27    SimpleKofaVocabulary, academic_sessions_vocab, validate_email)
28from waeup.kofa.schema import FormattedDate, TextLineChoice
29from waeup.kofa.students.vocabularies import nats_vocab, GenderSource
30from waeup.kofa.applicants.interfaces import (
31    contextual_reg_num_source,
32    IApplicant, IApplicantEdit, IApplicantUpdateByRegNo)
33from kofacustom.nigeria.applicants.interfaces import (
34    LGASource, high_qual, high_grade, exam_types,
35    INigeriaApplicantOnlinePayment,
36    )
37from kofacustom.ekodisco.interfaces import MessageFactory as _
38from kofacustom.ekodisco.payments.interfaces import ICustomOnlinePayment
39
40class ICustomApplicant(IApplicant):
41    """An applicant.
42
43    """
44
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        )
69
70class ICustomApplicantEdit(IApplicantEdit):
71    """An applicant interface for edit forms.
72
73    Here we can repeat the fields from base data and set the
74    `required` and `readonly` attributes to True to further restrict
75    the data access. Or we can allow only certain certificates to be
76    selected by choosing the appropriate source.
77
78    We cannot omit fields here. This has to be done in the
79    respective form page.
80    """
81
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        )
106
107class ICustomApplicantOnlinePayment(INigeriaApplicantOnlinePayment):
108    """An applicant payment via payment gateways.
109
110    """
111
112class ICustomApplicantUpdateByRegNo(IApplicantUpdateByRegNo):
113    """Representation of an applicant.
114
115    Skip regular reg_number validation if reg_number is used for finding
116    the applicant object.
117    """
Note: See TracBrowser for help on using the repository browser.