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

Last change on this file since 12813 was 12613, checked in by Henrik Bettermann, 10 years ago

Add Furniture Making

  • Property svn:keywords set to Id
File size: 10.2 KB
Line 
1## $Id: utils.py 12613 2015-02-13 11:35:49Z 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        'awaiting_results': 'Awaiting Results',
67        'basic_electricity': 'Basic Electricity',
68        'bible_knowledge': 'Bible Knowledge',
69        'biology': 'Biology',
70        'biology_alt_syl': 'Biology (Alt.Syl)',
71        'book_keeping': 'Book Keeping',
72        'building_construction': 'Building Construction',
73        'business_management': 'Business Management',
74        'business_construction_management': 'Business/Construction Management (Adv)',
75        'chemistry': 'Chemistry',
76        'chemistry_alt_syl': 'Chemistry (Alt.Syl)',
77        'christian_religious_studies': 'Christian Religious Studies',
78        'class_teaching': 'Class Teaching',
79        'clerical_office_duties': 'Clerical Office Duties',
80        'clothing_and_textiles': 'Clothing and Textiles',
81        'commerce': 'Commerce',
82        'economics': 'Economics',
83        'education': 'Education',
84        'efik': 'Efik',
85        'electronics': 'Electronics',
86        'elementary_surveying': 'Elementary Surveying',
87        'english_language': 'English Language',
88        'engineering_science': 'Engineering Science',
89        'financial_accounting': 'Financial Accounting',
90        'food_and_nutrition': 'Food and Nutrition',
91        'french': 'French',
92        'further_mathematics': 'Further Mathematics',
93        'general_science': 'General Science',
94        'geography': 'Geography',
95        'german': 'German',
96        'government': 'Government',
97        'hausa': 'Hausa',
98        'hausa_literature': 'Hausa Literature',
99        'health_science': 'Health Science',
100        'history': 'History',
101        'home_management': 'Home Management',
102        'human_biology': 'Human Biology',
103        'industrial_electrical_installation': 'Industrial Elect Installation (Adv)',
104        'intergrated_science': 'Intergrated Science',
105        'islamic_studies': 'Islamic Studies',
106        'literature_in_english': 'Literature in English',
107        'literature_in_nigerian_languages': 'Literature in Nigerian Languages',
108        'igbo': 'Igbo',
109        'igbo_literature': 'Igbo Literature',
110        'yoruba': 'Yoruba',
111        'yoruba_literature': 'Yoruba Literature',
112        'management_in_living': 'Management in Living',
113        'mathematics': 'Mathematics',
114        'metalwork': 'Metalwork',
115        'music': 'Music',
116        'nigerian_language': 'Nigerian Language',
117        'office_practice': 'Office Practice',
118        'physical_education': 'Physical Education',
119        'physical_health_education': 'Physical and Health Education',
120        'physics': 'Physics',
121        'physics_alt_syl': 'Physics (Alt.Syl)',
122        'principles_and_practice_of_education': 'Principles and Practice of Education',
123        'principles_of_cost_accounting': 'Principles of Cost Accounting',
124        'rural_science': 'Rural Science',
125        'science': 'Science',
126        'secretarial_duties': 'Secretarial Duties',
127        'shorthand': 'Shorthand',
128        'sierra_leone_studies': 'Sierra Leone Studies',
129        'sierra_leone_languages': 'Sierra Leone Languages',
130        'social_studies': 'Social Studies',
131        'statistics': 'Statistics',
132        'teaching_practice': 'Teaching Practice',
133        'technical_drawing': 'Technical Drawing',
134        'typewriting': 'Typewriting',
135        'visual_art': 'Visual Art',
136        'woodwork': 'Woodwork',
137        'winding_elect_machines': 'Winding of Elect Machines and Elect Eng Sc',
138        'first_written': 'First Written',
139        'second_written': 'Second Written',
140        'pract_tests': 'Practical Tests',
141        # Added 25/08/2014
142        'animal_husbandry_(alt_a)': 'Animal Husbandry (Alt A)',
143        'animal_husbandry_(alt_b)': 'Animal Husbandry (Alt B)',
144        'auto_electrical_work': 'Auto Electrical Work',
145        'auto_mechanical_work': 'Auto Mechanical Work',
146        'catering_craft_practice': 'Catering Craft Practice',
147        'civic_education': 'Civic Education',
148        'computer_studies': 'Computer Studies',
149        'cosmetology': 'Cosmetology',
150        'data_processing': 'Data Processing',
151        'dyeing_&_bleaching': 'Dyeing & Bleaching',
152        'electrical_installation_and_maintenance_work': 'Electrical Installation and Maintenance Work',
153        'fisheries_(alt_a)_ghana_candidates': 'Fisheries (Alt A) Ghana Candidates',
154        'fisheries_(alt_b)_nigeria_candidates': 'Fisheries (Alt B) Nigeria Candidates',
155        'garment_making': 'Garment Making',
156        'general_agriculture': 'General Agriculture',
157        'gsm_phones_maintenance_and_repairs': 'Gsm Phones Maintenance and Repairs',
158        'health_education': 'Health Education',
159        'insurance': 'Insurance',
160        'painting_and_decorating': 'Painting and Decorating',
161        'photography': 'Photography',
162        'printing_craft_practice': 'Printing Craft Practice',
163        'store_management': 'Store Management',
164        'textiles': 'Textiles',
165        # Added after 19/01/2015
166        'marketing': 'Marketing',
167        'carpentry_joinery': 'Carpentry and Joinery',
168        'tourism': 'Tourism',
169        'mining': 'Mining',
170        'furniture_making': 'Furniture Making',
171        }
172
173    EXAM_GRADES = (
174        ('A1', 'Excellent (A1)'),
175        ('A2', 'Very Good (A2)'),
176        ('A3', 'Good (A3)'),
177        ('B2', 'Very Good (B2)'),
178        ('B3', 'Good (B3)'),
179        ('C4', 'Credit (C4)'),
180        ('C5', 'Credit (C5)'),
181        ('C6', 'Credit (C6)'),
182        ('A', 'Pass (A)'),
183        ('B', 'Pass (B)'),
184        ('C', 'Pass (C)'),
185        ('U', 'Pass (U)'),
186        ('D7', 'Pass (D7)'),
187        ('P7', 'Pass (P7)'),
188        ('P8', 'Pass (P8)'),
189        ('E8', 'Pass (E8)'),
190        ('F9', 'Fail (F9)'),
191        ('Aa', 'A (a)'),
192        ('Bb', 'B (b)'),
193        ('Cc', 'C (c)'),
194        ('Dd', 'D (d)'),
195        ('Ee', 'E (e)'),
196        ('Ff', 'F (f)'),
197        ('Gg', 'G (g)'),
198        ('credit-1', 'Credit-1'),
199        ('credit-2', 'Credit-2'),
200        ('dist', 'Distinction'),
201        ('pass', 'Pass'), 
202        ('AR', 'Awaiting Results'),
203        )
204
205    INST_TYPES_DICT = {
206        'none': '',
207        'faculty': 'Faculty of',
208        'department': 'Department of',
209        'school': 'School of',
210        'office': 'Office for',
211        'centre': 'Centre for',
212        'institute': 'Institute of',
213        'school_for': 'School for',
214        'college': 'College of',
215        'directorate': 'Directorate of',
216        }
217
218    STUDY_MODES_DICT = {
219        'ume_ft': 'UME Full Time',
220        'ug_ft': 'Undergraduate Full Time',
221        'ug_pt': 'Undergraduate Part Time',
222        'dp_pt': 'Diploma Part Time',
223        'ct_ft': 'Certificate Full Time',
224        'dp_ft': 'Diploma Full Time',
225        'de_ft': 'Direct Entry Full Time',
226        'de_pt': 'Direct Entry Part Time',
227        'nd_ft': 'National Diploma Full Time',
228        'nd_pt': 'National Diploma Part Time',
229        'hnd_ft': 'Higher National Diploma Full Time',
230        'hnd_pt': 'Higher National Diploma Part Time',
231        'pg_ft': 'Postgraduate Full Time',
232        'pg_pt': 'Postgraduate Part Time',
233        'pgd_ft': 'Postgraduate Diploma Full Time',
234        'pgd_pt': 'Postgraduate Diploma Part Time',
235        'special_pg_pt': 'Special Postgraduate Part Time',
236        'nce_ft': 'NCE Full Time',
237        'nce_pt': 'NCE Part Time',
238        'ug_sw': 'Undergraduate Sandwich',
239        'nce_sw': 'NCE Sandwich',
240        'jm_ft': 'Joint Matriculation Full Time',
241        'ph_ft': 'Post Higher Education Full Time',
242        'transfer_pt': 'Transfer Part Time',
243        'transfer_ft': 'Transfer Full Time',
244        'ct_pt': 'Certificate Part Time',
245        'rmd_ft': 'Remedial with deficiencies',
246        'rm_ft': 'Remedial',
247        'transfer': 'Transfer',
248        'prence': 'Pre-NCE',
249        'prend': 'Pre-ND',
250        'pce': 'PCE',
251        'pd_ft': 'Professional Diploma in Education',
252        'found': 'Foundation',
253        'no': 'no application',
254        }
255
256    APP_CATS_DICT = {
257        'basic': 'PUTME, PUDE, PCE, PRENCE',
258        'no': 'No Application',
259        'pg_ft': 'Postgraduate Full-Time',
260        'pg_pt': 'Postgraduate Part-Time',
261        'sandwich': 'Sandwich',
262        'cest': 'Part-Time, Diploma, Certificate',
263        }
264
265    @property
266    def tzinfo(self):
267        return pytz.timezone('Africa/Lagos')
Note: See TracBrowser for help on using the repository browser.