source: main/waeup.futminna/trunk/src/waeup/futminna/applicants/interfaces.py @ 8981

Last change on this file since 8981 was 8981, 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
RevLine 
[7853]1## $Id: interfaces.py 8981 2012-07-12 08:53:27Z 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
[8012]21from zope import schema
[8051]22from waeup.kofa.applicants.interfaces import (
[8053]23    IApplicantBaseData,
[8051]24    AppCatCertificateSource, CertificateSource)
25from waeup.kofa.schoolgrades import ResultEntryField
[8530]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
[8932]31from kofacustom.nigeria.applicants.interfaces import (
32    LGASource, high_qual, high_grade, exam_types,
33    INigeriaUGApplicant, INigeriaPGApplicant,
34    INigeriaApplicantOnlinePayment,
[8981]35    INigeriaUGApplicantEdit, INigeriaPGApplicantEdit,
36    INigeriaApplicantUpdateByRegNo,
37    IPUTMEApplicantEdit,
[8932]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    )
[8619]49from waeup.futminna.interfaces import MessageFactory as _
50from waeup.futminna.payments.interfaces import ICustomOnlinePayment
[7853]51
[8932]52class ICustomUGApplicant(INigeriaUGApplicant):
[8012]53    """An undergraduate applicant.
54
[8519]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.
[8012]58    """
59
[8932]60class ICustomPGApplicant(INigeriaPGApplicant):
[7853]61    """A postgraduate applicant.
62
[8519]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.
[7866]66    """
67
[8932]68class ICustomApplicant(ICustomUGApplicant, ICustomPGApplicant):
[8012]69    """An interface for both types of applicants.
70
[8932]71    Attention: The ICustomPGApplicant field seetings will be overwritten
72    by ICustomPGApplicant field settings. If a field is defined
[8730]73    in both interfaces zope.schema validates only against the
[8932]74    constraints in ICustomUGApplicant. This does not affect the forms
75    since they are build on either ICustomUGApplicant or ICustomPGApplicant.
[8012]76    """
77
[8744]78    def writeLogMessage(view, comment):
[8053]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
[8981]87class ICustomUGApplicantEdit(INigeriaUGApplicantEdit):
[8730]88    """An undergraduate applicant interface for edit forms.
[8012]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
[8981]99class ICustomPGApplicantEdit(INigeriaPGApplicantEdit):
[7866]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.
[8017]109    """
[8454]110
[8932]111class ICustomApplicantOnlinePayment(INigeriaApplicantOnlinePayment):
[8247]112    """An applicant payment via payment gateways.
113
114    """
[8530]115
[8981]116class IPUTMEApplicantEdit(IPUTMEApplicantEdit):
[8530]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
[8981]128class ICustomApplicantUpdateByRegNo(INigeriaApplicantUpdateByRegNo):
[8582]129    """Representation of an applicant.
130
131    Skip regular reg_number validation if reg_number is used for finding
132    the applicant object.
133    """
[8981]134
Note: See TracBrowser for help on using the repository browser.