source: main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/utils/utils.py @ 9247

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

Add special Uniben pg study mode.

  • Property svn:keywords set to Id
File size: 7.9 KB
Line 
1## $Id: utils.py 9247 2012-09-27 21:22:40Z henrik $
2##
3## Copyright (C) 2012 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"""Customize general helper utilities for Kofa.
19"""
20import os
21import pytz
22from waeup.kofa.utils.utils import KofaUtils, sorted_phone_prefixes
23from kofacustom.nigeria.interfaces import MessageFactory as _
24
25INT_PHONE_PREFIXES = [
26    (1, _('Nigeria'), '234'),
27    (99, _('Germany'), '49'),
28    (99, _('United States'), '1'),
29    (99, _('Niger'), '227'),
30    (99, _('Benin'), '229'),
31    (99, _('Cameroon'), '237'),
32    (99, _('United Kingdom'), '44'),
33    (99, _('France'), '33'),
34    ]
35
36class NigeriaKofaUtils(KofaUtils):
37    """A collection of methods subject to customization.
38    """
39    PORTAL_LANGUAGE = 'en'
40
41    PREFERRED_LANGUAGES_DICT = {
42        'en':(1, u'English'),
43        'fr':(2, u'Français'),
44        'de':(3, u'Deutsch'),
45        'ha':(4, u'Hausa'),
46        'yo':(5, u'Yoruba'),
47        'ig':(6, u'Igbo'),
48        }
49
50    #: A function to return
51    @classmethod
52    def sorted_phone_prefixes(cls, data=INT_PHONE_PREFIXES, request=None):
53        return sorted_phone_prefixes(data, request)
54
55    EXAM_SUBJECTS_DICT = {
56        'accounts': 'Accounts',
57        'add_general_science': 'Add General Science',
58        'add_maths': 'Add Maths',
59        'adv_elect_install_maint': 'Adv. Electrical Installation and Maintenance',
60        'agricultural_science': 'Agricultural Science',
61        'applied_electricity': 'Applied Electricity',
62        'arabi': 'Arabic',
63        'arithmetics': 'Arithmetics',
64        'art': 'Art',
65        'auto_mechanics': 'Auto Mechanics',
66        'basic_electricity': 'Basic Electricity',
67        'bible_knowledge': 'Bible Knowledge',
68        'biology': 'Biology',
69        'biology_alt_syl': 'Biology (Alt.Syl)',
70        'book_keeping': 'Book Keeping',
71        'building_construction': 'Building Construction',
72        'business_management': 'Business Management',
73        'business_construction_management': 'Business/Construction Management (Adv)',
74        'chemistry': 'Chemistry',
75        'chemistry_alt_syl': 'Chemistry (Alt.Syl)',
76        'christian_religious_studies': 'Christian Religious Studies',
77        'class_teaching': 'Class Teaching',
78        'clerical_office_duties': 'Clerical Office Duties',
79        'clothing_and_textiles': 'Clothing and Textiles',
80        'commerce': 'Commerce',
81        'economics': 'Economics',
82        'education': 'Education',
83        'efik': 'Efik',
84        'electronics': 'Electronics',
85        'elementary_surveying': 'Elementary Surveying',
86        'english_language': 'English Language',
87        'engineering_science': 'Engineering Science',
88        'financial_accounting': 'Financial Accounting',
89        'food_and_nutrition': 'Food and Nutrition',
90        'french': 'French',
91        'further_mathematics': 'Further Mathematics',
92        'general_science': 'General Science',
93        'geography': 'Geography',
94        'german': 'German',
95        'government': 'Government',
96        'hausa': 'Hausa',
97        'hausa_literature': 'Hausa Literature',
98        'health_science': 'Health Science',
99        'history': 'History',
100        'home_management': 'Home Management',
101        'human_biology': 'Human Biology',
102        'industrial_electrical_installation': 'Industrial Elect Installation (Adv)',
103        'intergrated_science': 'Intergrated Science',
104        'islamic_studies': 'Islamic Studies',
105        'literature_in_english': 'Literature in English',
106        'literature_in_nigerian_languages': 'Literature in Nigerian Languages',
107        'igbo': 'Igbo',
108        'igbo_literature': 'Igbo Literature',
109        'yoruba': 'Yoruba',
110        'yoruba_literature': 'Yoruba Literature',
111        'management_in_living': 'Management in Living',
112        'mathematics': 'Mathematics',
113        'metalwork': 'Metalwork',
114        'music': 'Music',
115        'nigerian_language': 'Nigerian Language',
116        'office_practice': 'Office Practice',
117        'physical_education': 'Physical Education',
118        'physical_health_education': 'Physical and Health Education',
119        'physics': 'Physics',
120        'physics_alt_syl': 'Physics (Alt.Syl)',
121        'principles_and_practice_of_education': 'Principles and Practice of Education',
122        'principles_of_cost_accounting': 'Principles of Cost Accounting',
123        'rural_science': 'Rural Science',
124        'science': 'Science',
125        'secretarial_duties': 'Secretarial Duties',
126        'shorthand': 'Shorthand',
127        'sierra_leone_studies': 'Sierra Leone Studies',
128        'sierra_leone_languages': 'Sierra Leone Languages',
129        'social_studies': 'Social Studies',
130        'statistics': 'Statistics',
131        'teaching_practice': 'Teaching Practice',
132        'technical_drawing': 'Technical Drawing',
133        'typewriting': 'Typewriting',
134        'visual_art': 'Visual Art',
135        'woodwork': 'Woodwork',
136        'winding_elect_machines': 'Winding of Elect Machines and Elect Eng Sc'
137        }
138
139    EXAM_GRADES = (
140        ('A1', 'Excellent (A1)'),
141        ('A2', 'Very Good (A2)'),
142        ('A3', 'Good (A3)'),
143        ('B2', 'Very Good (B2)'),
144        ('B3', 'Good (B3)'),
145        ('C4', 'Credit (C4)'),
146        ('C5', 'Credit (C5)'),
147        ('C6', 'Credit (C6)'),
148        ('A', 'Pass (A)'),
149        ('B', 'Pass (B)'),
150        ('C', 'Pass (C)'),
151        ('U', 'Pass (U)'),
152        ('D7', 'Pass (D7)'),
153        ('P7', 'Pass (P7)'),
154        ('P8', 'Pass (P8)'),
155        ('E8', 'Pass (E8)'),
156        ('F9', 'Fail (F9)'),
157        ('Aa', 'A (a)'),
158        ('Bb', 'B (b)'),
159        ('Cc', 'C (c)'),
160        ('Dd', 'D (d)'),
161        ('Ee', 'E (e)'),
162        ('Ff', 'F (f)'),
163        ('Gg', 'G (g)')
164        )
165
166    INST_TYPES_DICT = {
167        'none': '',
168        'faculty': 'Faculty of',
169        'department': 'Department of',
170        'school': 'School of',
171        'office': 'Office for',
172        'centre': 'Centre for',
173        'institute': 'Institute of',
174        'school_for': 'School for',
175        'college': 'College of',
176        }
177
178    STUDY_MODES_DICT = {
179        'ume_ft': 'UME Full Time',
180        'ug_ft': 'Undergraduate Full Time',
181        'ug_pt': 'Undergraduate Part Time',
182        'dp_pt': 'Diploma Part Time',
183        'ct_ft': 'Certificate Full Time',
184        'dp_ft': 'Diploma Full Time',
185        'de_ft': 'Direct Entry Full Time',
186        'de_pt': 'Direct Entry Part Time',
187        'pg_ft': 'Postgraduate Full Time',
188        'pg_pt': 'Postgraduate Part Time',
189        'special_pg_pt': 'Special Uniben Postgraduate Part Time',
190        'ug_sw': 'Undergraduate Sandwich',
191        'jm_ft': 'Joint Matriculation Full Time',
192        'ph_ft': 'Post Higher Education Full Time',
193        'transfer_pt': 'Transfer Part Time',
194        'transfer_ft': 'Transfer Full Time',
195        'ct_pt': 'Certificate Part Time',
196        'rmd_ft': 'Remedial with deficiencies',
197        'rm_ft': 'Remedial',
198        'transfer': 'Transfer',
199        'prence': 'Pre-NCE',
200        'pce': 'PCE',
201        'pd_ft': 'Professional Diploma in Education',
202        }
203
204    APP_CATS_DICT = {
205        'basic': 'PUTME, PUDE, PCE, PRENCE',
206        'no': 'No Application',
207        'pg_ft': 'Postgraduate Full-Time',
208        'pg_pt': 'Postgraduate Part-Time',
209        'sandwich': 'Sandwich',
210        'cest': 'Part-Time, Diploma, Certificate',
211        'pg_new': 'New Postgraduate Programmes',
212        }
213
214    @property
215    def tzinfo(self):
216        return pytz.timezone('Africa/Lagos')
Note: See TracBrowser for help on using the repository browser.