source: main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/applicants/applicant.py @ 16067

Last change on this file since 16067 was 16067, checked in by Henrik Bettermann, 5 years ago

Customize ApplicantRefereeReportExporter?.

  • Property svn:keywords set to Id
File size: 2.6 KB
RevLine 
[10765]1## $Id: applicant.py 16067 2020-04-21 08:15:24Z 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
19import grok
20from zope.interface import implementedBy
[15878]21from zope.component import getUtility
22from waeup.kofa.interfaces import IExtFileStore
[10765]23from waeup.kofa.applicants.applicant import ApplicantFactory
[16062]24from waeup.kofa.applicants.refereereport import (
25    ApplicantRefereeReport, ApplicantRefereeReportFactory)
[10765]26from waeup.kofa.utils.helpers import attrs_to_fields
27from kofacustom.nigeria.applicants.applicant import NigeriaApplicant
[15563]28from kofacustom.iuokada.applicants.interfaces import(
[16062]29    ICustomApplicant, ICustomUGApplicantEdit, ICustomPGApplicantEdit,
30    IPUTMEApplicantEdit, ICustomApplicantRefereeReport)
[10765]31
32class CustomApplicant(NigeriaApplicant):
33
34    grok.implements(ICustomApplicant, ICustomUGApplicantEdit,
35        ICustomPGApplicantEdit, IPUTMEApplicantEdit)
36    grok.provides(ICustomApplicant)
37
[16067]38    @property
39    def refereereports(self):
40        reports = [value for value in self.values()
41            if isinstance(value, CustomApplicantRefereeReport)]
42        return reports
43
[10765]44CustomApplicant = attrs_to_fields(CustomApplicant)
45
46class CustomApplicantFactory(ApplicantFactory):
47    """A factory for customized applicants.
48    """
49
50    def __call__(self, *args, **kw):
51        return CustomApplicant()
52
53    def getInterfaces(self):
54        return implementedBy(CustomApplicant)
[16062]55
56class CustomApplicantRefereeReport(ApplicantRefereeReport):
57    """This is a custom referee report.
58    """
59    grok.implements(ICustomApplicantRefereeReport)
60    grok.provides(ICustomApplicantRefereeReport)
61
62CustomApplicantRefereeReport = attrs_to_fields(CustomApplicantRefereeReport)
63
64class CustomApplicantRefereeReportFactory(ApplicantRefereeReportFactory):
65    """A factory for applicant online payments.
66    """
67
68    def __call__(self, *args, **kw):
69        return CustomApplicantRefereeReport()
70
71    def getInterfaces(self):
72        return implementedBy(CustomApplicantRefereeReport)
73
Note: See TracBrowser for help on using the repository browser.