source: main/waeup.uniben/trunk/src/waeup/uniben/applicants/interfaces.py @ 9056

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

Adjust browser pages to changes made in kofacustom.nigeria.

Remove customization only for extended LGASource.

  • Property svn:keywords set to Id
File size: 5.1 KB
Line 
1## $Id: interfaces.py 9056 2012-07-26 06:58:38Z 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    UG_OMIT_DISPLAY_FIELDS,
39    UG_OMIT_PDF_FIELDS,
40    UG_OMIT_MANAGE_FIELDS,
41    UG_OMIT_EDIT_FIELDS,
42    PG_OMIT_DISPLAY_FIELDS,
43    PG_OMIT_PDF_FIELDS,
44    PG_OMIT_MANAGE_FIELDS,
45    PG_OMIT_EDIT_FIELDS,
46    PUTME_OMIT_DISPLAY_FIELDS,
47    PUTME_OMIT_PDF_FIELDS,
48    PUTME_OMIT_MANAGE_FIELDS,
49    PUTME_OMIT_EDIT_FIELDS,
50    PUTME_OMIT_RESULT_SLIP_FIELDS,
51    PUDE_OMIT_DISPLAY_FIELDS,
52    PUDE_OMIT_PDF_FIELDS,
53    PUDE_OMIT_MANAGE_FIELDS,
54    PUDE_OMIT_EDIT_FIELDS,
55    PUDE_OMIT_RESULT_SLIP_FIELDS,
56    )
57from waeup.uniben.interfaces import MessageFactory as _
58from waeup.uniben.payments.interfaces import ICustomOnlinePayment
59
60class ICustomUGApplicant(INigeriaUGApplicant):
61    """An undergraduate applicant.
62
63    This interface defines the least common multiple of all fields
64    in ug application forms. In customized forms, fields can be excluded by
65    adding them to the UG_OMIT* tuples.
66    """
67
68class ICustomPGApplicant(INigeriaPGApplicant):
69    """A postgraduate applicant.
70
71    This interface defines the least common multiple of all fields
72    in pg application forms. In customized forms, fields can be excluded by
73    adding them to the PG_OMIT* tuples.
74    """
75
76
77class ICustomApplicant(ICustomUGApplicant, ICustomPGApplicant):
78    """An interface for both types of applicants.
79
80    Attention: The ICustomPGApplicant field seetings will be overwritten
81    by ICustomPGApplicant field settings. If a field is defined
82    in both interfaces zope.schema validates only against the
83    constraints in ICustomUGApplicant. This does not affect the forms
84    since they are build on either ICustomUGApplicant or ICustomPGApplicant.
85    """
86
87    def writeLogMessage(view, comment):
88        """Adds an INFO message to the log file
89        """
90
91    def createStudent():
92        """Create a student object from applicant data
93        and copy applicant object.
94        """
95
96class ICustomUGApplicantEdit(INigeriaUGApplicantEdit):
97    """An undergraduate applicant interface for edit forms.
98
99    Here we can repeat the fields from base data and set the
100    `required` and `readonly` attributes to True to further restrict
101    the data access. Or we can allow only certain certificates to be
102    selected by choosing the appropriate source.
103
104    We cannot omit fields here. This has to be done in the
105    respective form page.
106    """
107
108class ICustomPGApplicantEdit(INigeriaPGApplicantEdit):
109    """A postgraduate applicant interface for editing.
110
111    Here we can repeat the fields from base data and set the
112    `required` and `readonly` attributes to True to further restrict
113    the data access. Or we can allow only certain certificates to be
114    selected by choosing the appropriate source.
115
116    We cannot omit fields here. This has to be done in the
117    respective form page.
118    """
119
120class ICustomApplicantOnlinePayment(INigeriaApplicantOnlinePayment):
121    """An applicant payment via payment gateways.
122
123    """
124
125class IPUTMEApplicantEdit(IPUTMEApplicantEdit):
126    """An undergraduate applicant interface for editing.
127
128    Here we can repeat the fields from base data and set the
129    `required` and `readonly` attributes to True to further restrict
130    the data access. Or we can allow only certain certificates to be
131    selected by choosing the appropriate source.
132
133    We cannot omit fields here. This has to be done in the
134    respective form page.
135    """
136
137class ICustomApplicantUpdateByRegNo(INigeriaApplicantUpdateByRegNo):
138    """Representation of an applicant.
139
140    Skip regular reg_number validation if reg_number is used for finding
141    the applicant object.
142    """
Note: See TracBrowser for help on using the repository browser.