source: main/waeup.aaue/trunk/src/waeup/aaue/applicants/interfaces.py @ 8980

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

Merged with waeup.fceokene 8978:8979.

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