## $Id: utils.py 12371 2015-01-03 07:38:07Z henrik $ ## ## Copyright (C) 2012 Uli Fouquet & Henrik Bettermann ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation; either version 2 of the License, or ## (at your option) any later version. ## ## This program is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with this program; if not, write to the Free Software ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ## """Customize general helper utilities for Ikoba. """ import pytz from waeup.ikoba.utils.utils import IkobaUtils, sorted_phone_prefixes from ikobacustom.pcn.interfaces import MessageFactory as _ INT_PHONE_PREFIXES = [ (1, _('Nigeria'), '234'), (99, _('Germany'), '49'), (99, _('United States'), '1'), (99, _('Niger'), '227'), (99, _('Benin'), '229'), (99, _('Cameroon'), '237'), (99, _('United Kingdom'), '44'), (99, _('France'), '33'), ] class PCNIkobaUtils(IkobaUtils): """A collection of methods subject to customization. """ PORTAL_LANGUAGE = 'en' PREFERRED_LANGUAGES_DICT = { 'en':(1, u'English'), 'fr':(2, u'Français'), 'de':(3, u'Deutsch'), 'ha':(4, u'Hausa'), 'yo':(5, u'Yoruba'), 'ig':(6, u'Igbo'), } EXPORTER_NAMES = ( 'pdfdocuments', 'htmldocuments', 'users', 'products', 'customers', 'pcncustomerdocuments', 'pcncontracts') BATCH_PROCESSOR_NAMES = ( 'pcncustomerprocessor', 'pcncustomerdocumentprocessor', 'pcncontractprocessor', 'pcnproductprocessor', 'pdfdocumentprocessor', 'htmldocumentprocessor', 'userprocessor') #: A function to return @classmethod def sorted_phone_prefixes(cls, data=INT_PHONE_PREFIXES, request=None): return sorted_phone_prefixes(data, request) @property def tzinfo(self): return pytz.timezone('Africa/Lagos')