source: main/waeup.sirp/branches/ulif-fasttables/src/waeup/sirp/jambtables/applicants.py @ 5302

Last change on this file since 5302 was 5272, checked in by uli, 14 years ago

Provide a first basic implementation for Applicants. That might be renamed to Application in future.

File size: 4.0 KB
RevLine 
[5272]1##
2## applicants.py
3## Login : <uli@pu.smp.net>
4## Started on  Fri Jul 16 11:46:55 2010 Uli Fouquet
5## $Id$
6##
7## Copyright (C) 2010 Uli Fouquet
8## This program is free software; you can redistribute it and/or modify
9## it under the terms of the GNU General Public License as published by
10## the Free Software Foundation; either version 2 of the License, or
11## (at your option) any later version.
12##
13## This program is distributed in the hope that it will be useful,
14## but WITHOUT ANY WARRANTY; without even the implied warranty of
15## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16## GNU General Public License for more details.
17##
18## You should have received a copy of the GNU General Public License
19## along with this program; if not, write to the Free Software
20## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21##
22import grok
23from zope.schema.fieldproperty import FieldProperty
24from waeup.sirp.interfaces import IWAeUPSIRPPluggable
25from waeup.sirp.jambtables.interfaces import (
26    IResultEntry, IApplicant, IApplicantContainer
27    )
28
29class ResultEntry(grok.Context):
30    grok.implements(IResultEntry)
31
32    def __init__(self, subject=None, score=None):
33        self.subject = subject
34        self.score = score
35   
36
37class Applicant(grok.Context):
38    grok.implements(IApplicant)
39
40    fst_sit_results = FieldProperty(IApplicant['fst_sit_results'])
41   
42    def __init__(self):
43        self.reg_no = None
44        self.access_code = None
45        self.serial = None
46        self.course1 = None
47        self.course2 = None
48        self.course3 = None
49        self.firstname = None
50        self.middlenames = None
51        self.lastname = None
52        self.jamb_age = None
53        self.date_of_birth = None
54        self.jamb_state = None
55        self.jamb_lga = None
56        self.lga = None
57        self.sex = None
58        self.email = None
59        self.phone = None
60        self.passport = False
61        self.aos = None
62        self.subj1 = None
63        self.subj2 = None
64        self.subj3 = None
65        self.hq_matric_no = None
66        self.hq_type = None
67        self.hq_grade = None
68        self.hq_school = None
69        self.hq_session = None
70        self.hq_disc = None
71        self.fst_sit_fname = None
72        self.fst_sit_no = None
73        self.fst_sit_date = None
74        self.fst_sit_type = None
75        #self.fst_sit_results = []
76        self.fst_sit_results = None
77        #self.fst_sit_results = ResultEntry()
78        self.scd_sit_fname = None
79        self.scd_sit_no = None
80        self.scd_sit_date = None
81        self.scd_sit_type = None
82        self.scd_sit_results = None
83        self.eng_score = None
84        self.subj1score = None
85        self.subj2score = None
86        self.subj3score = None
87        self.application_date = None
88        self.status = None
89        self.screening_date = None
90        self.screening_type = None
91        self.screening_score = None
92        self.screening_venue = None
93        self.total_score = None
94        self.course_admitted = None
95        self.department = None
96        self.faculty = None
97        self.entry_session = None
98        self.notice = None
99        self.student_id = None
100        self.import_record_no = None
101        self.imported_by = None
102        self.import_date = None
103        self.import_from = None
104
105class ApplicantContainer(grok.Container):
106    grok.implements(IApplicantContainer)
107
108class AccessCodePlugin(grok.GlobalUtility):
109    grok.name('applications')
110    grok.implements(IWAeUPSIRPPluggable)
111
112    def setup(self, site, name, logger):
113        site['applications'] = ApplicantContainer()
114        logger.info('Installed application container.')
115        return
116
117    def update(self, site, name, logger):
118        if not 'applications' in site.keys():
119            logger.info('Updating site at %s. Installing applications.' % (
120                    site,))
121            self.setup(site, name, logger)
122        else:
123            logger.info(
124                'ApplicantsPlugin: Updating site at %s: Nothing to do.' % (
125                    site, ))
126        return
Note: See TracBrowser for help on using the repository browser.