[12175] | 1 | ## $Id: utils.py 12617 2015-02-14 17:22:51Z 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 Ikoba. |
---|
| 19 | """ |
---|
| 20 | import pytz |
---|
| 21 | from waeup.ikoba.utils.utils import IkobaUtils, sorted_phone_prefixes |
---|
[12371] | 22 | from ikobacustom.pcn.interfaces import MessageFactory as _ |
---|
[12175] | 23 | |
---|
| 24 | INT_PHONE_PREFIXES = [ |
---|
| 25 | (1, _('Nigeria'), '234'), |
---|
| 26 | (99, _('Germany'), '49'), |
---|
| 27 | (99, _('United States'), '1'), |
---|
| 28 | (99, _('Niger'), '227'), |
---|
| 29 | (99, _('Benin'), '229'), |
---|
| 30 | (99, _('Cameroon'), '237'), |
---|
| 31 | (99, _('United Kingdom'), '44'), |
---|
| 32 | (99, _('France'), '33'), |
---|
| 33 | ] |
---|
| 34 | |
---|
[12371] | 35 | class PCNIkobaUtils(IkobaUtils): |
---|
[12175] | 36 | """A collection of methods subject to customization. |
---|
| 37 | """ |
---|
| 38 | PORTAL_LANGUAGE = 'en' |
---|
| 39 | |
---|
[12380] | 40 | # CURRENCIES must be equal to or an excerpt of ISO_4217_CURRENCIES |
---|
| 41 | CURRENCIES = { |
---|
| 42 | 'EUR': ('EUROPE', _('Euro'), 2, '978'), |
---|
| 43 | 'USD': ('U.S.', _('US Dollar'), 2, '840'), |
---|
| 44 | 'NGN': ('NIGERIA', _('Naira'), 2, '566'), |
---|
| 45 | } |
---|
| 46 | |
---|
[12385] | 47 | CON_CATS_DICT = { |
---|
[12488] | 48 | 'ron': 'Retention of Name', |
---|
[12499] | 49 | 'rop': 'Registration of Premises', |
---|
[12571] | 50 | 'rpr': 'Registration in the Provisional Register', |
---|
[12591] | 51 | 'rpc': 'Registration as Pharmaceutical Chemist', |
---|
[12601] | 52 | 'ippmvl': 'Issuance of Patent and Proprietary Medicines Vendors License', |
---|
[12604] | 53 | 'rppmvl': 'Renewal of Patent and Proprietary Medicines Vendors License', |
---|
[12611] | 54 | 'appit': 'Accepting Pupil Pharmacist for Internship Training', |
---|
[12615] | 55 | 'rpt': 'Registration as a Pharmacy Technician', |
---|
[12617] | 56 | 'appt': 'Annual Permit for Pharmacy Technician', |
---|
[12546] | 57 | 'no': 'no license', |
---|
[12385] | 58 | } |
---|
| 59 | |
---|
[12175] | 60 | PREFERRED_LANGUAGES_DICT = { |
---|
| 61 | 'en':(1, u'English'), |
---|
| 62 | 'fr':(2, u'Français'), |
---|
| 63 | 'de':(3, u'Deutsch'), |
---|
| 64 | 'ha':(4, u'Hausa'), |
---|
| 65 | 'yo':(5, u'Yoruba'), |
---|
| 66 | 'ig':(6, u'Igbo'), |
---|
| 67 | } |
---|
| 68 | |
---|
[12298] | 69 | EXPORTER_NAMES = ( |
---|
[12284] | 70 | 'pdfdocuments', |
---|
| 71 | 'htmldocuments', |
---|
[12412] | 72 | 'restdocuments', |
---|
[12284] | 73 | 'users', |
---|
[12298] | 74 | 'products', |
---|
| 75 | 'customers', |
---|
[12384] | 76 | 'pcncustomerjpgdocuments', |
---|
| 77 | 'pcncustomerpdfdocuments', |
---|
[12499] | 78 | 'roncontracts', |
---|
[12591] | 79 | 'ropcontracts', |
---|
| 80 | 'rprcontracts', |
---|
[12601] | 81 | 'rpccontracts', |
---|
[12604] | 82 | 'ippmvlcontracts', |
---|
[12611] | 83 | 'rppmvlcontracts', |
---|
[12615] | 84 | 'appitcontracts', |
---|
[12617] | 85 | 'rptcontracts', |
---|
| 86 | 'apptcontracts') |
---|
[12284] | 87 | |
---|
| 88 | BATCH_PROCESSOR_NAMES = ( |
---|
[12371] | 89 | 'pcncustomerprocessor', |
---|
[12384] | 90 | 'pcncustomerjpgdocumentprocessor', |
---|
| 91 | 'pcncustomerpdfdocumentprocessor', |
---|
[12484] | 92 | 'roncontractprocessor', |
---|
[12499] | 93 | 'ropcontractprocessor', |
---|
[12591] | 94 | 'rprcontractprocessor', |
---|
| 95 | 'rpccontractprocessor', |
---|
[12601] | 96 | 'ippmvlcontractprocessor', |
---|
[12604] | 97 | 'rppmvlcontractprocessor', |
---|
[12615] | 98 | 'appitcontractprocessor', |
---|
| 99 | 'rptcontractprocessor', |
---|
[12617] | 100 | 'apptcontractprocessor', |
---|
[12371] | 101 | 'pcnproductprocessor', |
---|
[12284] | 102 | 'pdfdocumentprocessor', |
---|
| 103 | 'htmldocumentprocessor', |
---|
[12412] | 104 | 'restdocumentprocessor', |
---|
[12284] | 105 | 'userprocessor') |
---|
| 106 | |
---|
[12175] | 107 | #: A function to return |
---|
| 108 | @classmethod |
---|
| 109 | def sorted_phone_prefixes(cls, data=INT_PHONE_PREFIXES, request=None): |
---|
| 110 | return sorted_phone_prefixes(data, request) |
---|
| 111 | |
---|
| 112 | @property |
---|
| 113 | def tzinfo(self): |
---|
| 114 | return pytz.timezone('Africa/Lagos') |
---|