source: main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/applicants/interfaces.py @ 9347

Last change on this file since 9347 was 9347, checked in by Henrik Bettermann, 12 years ago

Base configuration

  • Property svn:keywords set to Id
File size: 4.6 KB
Line 
1## $Id: interfaces.py 9347 2012-10-18 05:42:30Z 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 contextual_reg_num_source
31from kofacustom.nigeria.applicants.interfaces import (
32    LGASource, high_qual, high_grade, exam_types,
33    INigeriaUGApplicant, INigeriaPGApplicant,
34    INigeriaApplicantOnlinePayment,
35    INigeriaUGApplicantEdit, INigeriaPGApplicantEdit,
36    INigeriaApplicantUpdateByRegNo,
37    IPUTMEApplicantEdit,
38    )
39from waeup.kwarapoly.interfaces import MessageFactory as _
40from waeup.kwarapoly.payments.interfaces import ICustomOnlinePayment
41
42class ICustomUGApplicant(INigeriaUGApplicant):
43    """An undergraduate applicant.
44
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.
48    """
49
50class ICustomPGApplicant(INigeriaPGApplicant):
51    """A postgraduate applicant.
52
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
58class ICustomApplicant(ICustomUGApplicant, ICustomPGApplicant):
59    """An interface for both types of applicants.
60
61    Attention: The ICustomPGApplicant field seetings will be overwritten
62    by ICustomPGApplicant field settings. If a field is defined
63    in both interfaces zope.schema validates only against the
64    constraints in ICustomUGApplicant. This does not affect the forms
65    since they are build on either ICustomUGApplicant or ICustomPGApplicant.
66    """
67
68    def writeLogMessage(view, comment):
69        """Adds an INFO message to the log file
70        """
71
72    def createStudent():
73        """Create a student object from applicatnt data
74        and copy applicant object.
75        """
76
77class ICustomUGApplicantEdit(INigeriaUGApplicantEdit):
78    """An undergraduate applicant interface for edit forms.
79
80    Here we can repeat the fields from base data and set the
81    `required` and `readonly` attributes to True to further restrict
82    the data access. Or we can allow only certain certificates to be
83    selected by choosing the appropriate source.
84
85    We cannot omit fields here. This has to be done in the
86    respective form page.
87    """
88
89class ICustomPGApplicantEdit(INigeriaPGApplicantEdit):
90    """A postgraduate applicant interface for editing.
91
92    Here we can repeat the fields from base data and set the
93    `required` and `readonly` attributes to True to further restrict
94    the data access. Or we can allow only certain certificates to be
95    selected by choosing the appropriate source.
96
97    We cannot omit fields here. This has to be done in the
98    respective form page.
99    """
100
101class ICustomApplicantOnlinePayment(INigeriaApplicantOnlinePayment):
102    """An applicant payment via payment gateways.
103
104    """
105
106class IPUTMEApplicantEdit(IPUTMEApplicantEdit):
107    """An undergraduate applicant interface for editing.
108
109    Here we can repeat the fields from base data and set the
110    `required` and `readonly` attributes to True to further restrict
111    the data access. Or we can allow only certain certificates to be
112    selected by choosing the appropriate source.
113
114    We cannot omit fields here. This has to be done in the
115    respective form page.
116    """
117
118class ICustomApplicantUpdateByRegNo(INigeriaApplicantUpdateByRegNo):
119    """Representation of an applicant.
120
121    Skip regular reg_number validation if reg_number is used for finding
122    the applicant object.
123    """
124
Note: See TracBrowser for help on using the repository browser.