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

Last change on this file since 13643 was 13618, checked in by Henrik Bettermann, 9 years ago

Extend deegrees dictionary.

  • Property svn:keywords set to Id
File size: 11.7 KB
Line 
1## $Id: utils.py 13618 2016-01-15 15:39:34Z 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 _
24from kofacustom.nigeria.utils.degrees import DEGREES_DICT
25
26INT_PHONE_PREFIXES = [
27    (1, _('Nigeria'), '234'),
28    (99, _('Germany'), '49'),
29    (99, _('United States'), '1'),
30    (99, _('Niger'), '227'),
31    (99, _('Benin'), '229'),
32    (99, _('Cameroon'), '237'),
33    (99, _('United Kingdom'), '44'),
34    (99, _('France'), '33'),
35    ]
36
37class NigeriaKofaUtils(KofaUtils):
38    """A collection of methods subject to customization.
39    """
40    PORTAL_LANGUAGE = 'en'
41
42    PREFERRED_LANGUAGES_DICT = {
43        'en':(1, u'English'),
44        'fr':(2, u'Français'),
45        'de':(3, u'Deutsch'),
46        'ha':(4, u'Hausa'),
47        'yo':(5, u'Yoruba'),
48        'ig':(6, u'Igbo'),
49        }
50
51    #: A function to return
52    @classmethod
53    def sorted_phone_prefixes(cls, data=INT_PHONE_PREFIXES, request=None):
54        return sorted_phone_prefixes(data, request)
55
56    DEGREES_DICT = DEGREES_DICT
57
58    EXAM_SUBJECTS_DICT = {
59        'accounts': 'Accounts',
60        'add_general_science': 'Add General Science',
61        'add_maths': 'Add Maths',
62        'adv_elect_install_maint': 'Adv. Electrical Installation and Maintenance',
63        'agricultural_science': 'Agricultural Science',
64        'applied_electricity': 'Applied Electricity',
65        'arabi': 'Arabic',
66        'arithmetics': 'Arithmetics',
67        'art': 'Art',
68        'auto_mechanics': 'Auto Mechanics',
69        'awaiting_results': 'Awaiting Results',
70        'basic_electricity': 'Basic Electricity',
71        'bible_knowledge': 'Bible Knowledge',
72        'biology': 'Biology',
73        'biology_alt_syl': 'Biology (Alt.Syl)',
74        'block_brick_concrete': 'Block Laying, Brick Laying and Concreting',
75        'book_keeping': 'Book Keeping',
76        'building_construction': 'Building Construction',
77        'business_management': 'Business Management',
78        'business_construction_management': 'Business/Construction Management (Adv)',
79        'chemistry': 'Chemistry',
80        'chemistry_alt_syl': 'Chemistry (Alt.Syl)',
81        'christian_religious_studies': 'Christian Religious Studies',
82        'class_teaching': 'Class Teaching',
83        'clerical_office_duties': 'Clerical Office Duties',
84        'clothing_and_textiles': 'Clothing and Textiles',
85        'commerce': 'Commerce',
86        'economics': 'Economics',
87        'education': 'Education',
88        'efik': 'Efik',
89        'electronics': 'Electronics',
90        'elementary_surveying': 'Elementary Surveying',
91        'english_language': 'English Language',
92        'engineering_science': 'Engineering Science',
93        'financial_accounting': 'Financial Accounting',
94        'fine_art': 'Fine Art',
95        'food_and_nutrition': 'Food and Nutrition',
96        'french': 'French',
97        'further_mathematics': 'Further Mathematics',
98        'general_science': 'General Science',
99        'geography': 'Geography',
100        'german': 'German',
101        'government': 'Government',
102        'hausa': 'Hausa',
103        'hausa_literature': 'Hausa Literature',
104        'health_science': 'Health Science',
105        'history': 'History',
106        'home_economics': 'Home Economics',
107        'home_management': 'Home Management',
108        'human_biology': 'Human Biology',
109        'industrial_electrical_installation': 'Industrial Elect Installation (Adv)',
110        'intergrated_science': 'Intergrated Science',
111        'islamic_studies': 'Islamic Studies',
112        'literature_in_english': 'Literature in English',
113        'literature_in_nigerian_languages': 'Literature in Nigerian Languages',
114        'igbo': 'Igbo',
115        'igbo_literature': 'Igbo Literature',
116        'yoruba': 'Yoruba',
117        'yoruba_literature': 'Yoruba Literature',
118        'management_in_living': 'Management in Living',
119        'mathematics': 'Mathematics',
120        'metalwork': 'Metalwork',
121        'music': 'Music',
122        'nigerian_language': 'Nigerian Language',
123        'office_practice': 'Office Practice',
124        'physical_education': 'Physical Education',
125        'physical_health_education': 'Physical and Health Education',
126        'physics': 'Physics',
127        'physics_alt_syl': 'Physics (Alt.Syl)',
128        'principles_and_practice_of_education': 'Principles and Practice of Education',
129        'principles_of_cost_accounting': 'Principles of Cost Accounting',
130        'rural_science': 'Rural Science',
131        'science': 'Science',
132        'secretarial_duties': 'Secretarial Duties',
133        'shorthand': 'Shorthand',
134        'sierra_leone_studies': 'Sierra Leone Studies',
135        'sierra_leone_languages': 'Sierra Leone Languages',
136        'social_studies': 'Social Studies',
137        'statistics': 'Statistics',
138        'teaching_practice': 'Teaching Practice',
139        'technical_drawing': 'Technical Drawing',
140        'typewriting': 'Typewriting',
141        'visual_art': 'Visual Art',
142        'woodwork': 'Woodwork',
143        'winding_elect_machines': 'Winding of Elect Machines and Elect Eng Sc',
144        'first_written': 'First Written',
145        'second_written': 'Second Written',
146        'pract_tests': 'Practical Tests',
147        # Added 25/08/2014
148        'animal_husbandry_(alt_a)': 'Animal Husbandry (Alt A)',
149        'animal_husbandry_(alt_b)': 'Animal Husbandry (Alt B)',
150        'auto_electrical_work': 'Auto Electrical Work',
151        'auto_mechanical_work': 'Auto Mechanical Work',
152        'catering_craft_practice': 'Catering Craft Practice',
153        'civic_education': 'Civic Education',
154        'computer_studies': 'Computer Studies',
155        'cosmetology': 'Cosmetology',
156        'data_processing': 'Data Processing',
157        'dyeing_&_bleaching': 'Dyeing & Bleaching',
158        'electrical_installation_and_maintenance_work': 'Electrical Installation and Maintenance Work',
159        'fisheries_(alt_a)_ghana_candidates': 'Fisheries (Alt A) Ghana Candidates',
160        'fisheries_(alt_b)_nigeria_candidates': 'Fisheries (Alt B) Nigeria Candidates',
161        'garment_making': 'Garment Making',
162        'general_agriculture': 'General Agriculture',
163        'gsm_phones_maintenance_and_repairs': 'Gsm Phones Maintenance and Repairs',
164        'health_education': 'Health Education',
165        'insurance': 'Insurance',
166        'painting_and_decorating': 'Painting and Decorating',
167        'photography': 'Photography',
168        'printing_craft_practice': 'Printing Craft Practice',
169        'store_management': 'Store Management',
170        'textiles': 'Textiles',
171        # Added after 19/01/2015
172        'marketing': 'Marketing',
173        'carpentry_joinery': 'Carpentry and Joinery',
174        'tourism': 'Tourism',
175        'mining': 'Mining',
176        'furniture_making': 'Furniture Making',
177        'information_communication_technology': 'Information and Communication Technology',
178        'salesmanship': 'Salesmanship',
179        }
180
181    EXAM_GRADES = (
182        ('A1', 'Excellent (A1)'),
183        ('A2', 'Very Good (A2)'),
184        ('A3', 'Good (A3)'),
185        ('B2', 'Very Good (B2)'),
186        ('B3', 'Good (B3)'),
187        ('C4', 'Credit (C4)'),
188        ('C5', 'Credit (C5)'),
189        ('C6', 'Credit (C6)'),
190        ('A', 'Pass (A)'),
191        ('B', 'Pass (B)'),
192        ('C', 'Pass (C)'),
193        ('U', 'Pass (U)'),
194        ('D7', 'Pass (D7)'),
195        ('P7', 'Pass (P7)'),
196        ('P8', 'Pass (P8)'),
197        ('E8', 'Pass (E8)'),
198        ('F9', 'Fail (F9)'),
199        ('Aa', 'A (a)'),
200        ('Bb', 'B (b)'),
201        ('Cc', 'C (c)'),
202        ('Dd', 'D (d)'),
203        ('Ee', 'E (e)'),
204        ('Ff', 'F (f)'),
205        ('Gg', 'G (g)'),
206        ('credit-1', 'Credit-1'),
207        ('credit-2', 'Credit-2'),
208        ('dist', 'Distinction'),
209        ('pass', 'Pass'), 
210        ('AR', 'Awaiting Results'),
211        )
212
213    INST_TYPES_DICT = {
214        'none': '',
215        'faculty': 'Faculty of',
216        'department': 'Department of',
217        'school': 'School of',
218        'office': 'Office for',
219        'centre': 'Centre for',
220        'institute': 'Institute of',
221        'school_for': 'School for',
222        'college': 'College of',
223        'directorate': 'Directorate of',
224        }
225
226    STUDY_MODES_DICT = {
227        'ume_ft': 'UME Full Time',
228        'ug_ft': 'Undergraduate Full Time',
229        'ug_pt': 'Undergraduate Part Time',
230        'dp_pt': 'Diploma Part Time',
231        'ct_ft': 'Certificate Full Time',
232        'dp_ft': 'Diploma Full Time',
233        'de_ft': 'Direct Entry Full Time',
234        'de_pt': 'Direct Entry Part Time',
235        'nd_ft': 'National Diploma Full Time',
236        'nd_pt': 'National Diploma Part Time',
237        'hnd_ft': 'Higher National Diploma Full Time',
238        'hnd_pt': 'Higher National Diploma Part Time',
239        'pg_ft': 'Postgraduate Full Time',
240        'pg_pt': 'Postgraduate Part Time',
241        'pgd_ft': 'Postgraduate Diploma Full Time',
242        'pgd_pt': 'Postgraduate Diploma Part Time',
243        'special_pg_pt': 'Special Postgraduate Part Time',
244        'nce_ft': 'NCE Full Time',
245        'nce_pt': 'NCE Part Time',
246        'ug_sw': 'Undergraduate Sandwich',
247        'nce_sw': 'NCE Sandwich',
248        'jm_ft': 'Joint Matriculation Full Time',
249        'ph_ft': 'Post Higher Education Full Time',
250        'transfer_pt': 'Transfer Part Time',
251        'transfer_ft': 'Transfer Full Time',
252        'ct_pt': 'Certificate Part Time',
253        'rmd_ft': 'Remedial with deficiencies',
254        'rm_ft': 'Remedial',
255        'transfer': 'Transfer',
256        'prence': 'Pre-NCE',
257        'prend': 'Pre-ND',
258        'pce': 'PCE',
259        'pd_ft': 'Professional Diploma in Education',
260        'found': 'Foundation',
261        'no': 'no application',
262        }
263
264    APP_CATS_DICT = {
265        'basic': 'PUTME, PUDE, PCE, PRENCE',
266        'no': 'No Application',
267        'pg_ft': 'Postgraduate Full-Time',
268        'pg_pt': 'Postgraduate Part-Time',
269        'sandwich': 'Sandwich',
270        'cest': 'Part-Time, Diploma, Certificate',
271        'pre': 'Pre-Degree Studies',
272        }
273
274    VERDICTS_DICT = {
275        '0': 'not yet',
276        'A': 'Successful student',
277        'B': 'Student with carryover courses',
278        'C': 'Student on probation',
279        'D': 'Withdrawn from the faculty',
280        'E': 'Student who were previously on probation',
281        'F': 'Medical case',
282        'G': 'Absent from examination',
283        'H': 'Withheld results',
284        'I': 'Expelled/rusticated/suspended student',
285        'J': 'Temporary withdrawn from the university',
286        'K': 'Unregistered student',
287        'L': 'Referred student',
288        'M': 'Reinstatement',
289        'N': 'Student on transfer',
290        #'O': 'NCE-III repeater', # FCEOkene only
291        'P': 'Exhausted maximum years in the university',
292        'Y': 'No previous verdict',
293        'X': 'New 300 level student (Uniben)',
294        'Z': 'Successful student (provisional)',
295        'A1': 'First Class',
296        'A2': 'Second Class Upper',
297        'A3': 'Second Class Lower',
298        'A4': 'Third Class',
299        'A5': 'Pass',
300        'A6': 'Distinction',
301        'A7': 'Credit',
302        'A8': 'Merit',
303        }
304
305
306    @property
307    def tzinfo(self):
308        return pytz.timezone('Africa/Lagos')
Note: See TracBrowser for help on using the repository browser.