Changeset 12378
- Timestamp:
- 3 Jan 2015, 13:41:03 (10 years ago)
- Location:
- main/waeup.ikoba/trunk/src/waeup/ikoba
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.ikoba/trunk/src/waeup/ikoba/interfaces.py
r12343 r12378 205 205 return value 206 206 207 class CurrencySource(BasicSourceFactory): 208 """A source for currencies. 209 """ 210 def getValues(self): 211 currencies = getUtility(IIkobaUtils).CURRENCIES 212 return currencies.keys() 213 214 def getToken(self, value): 215 return value 216 217 def getTitle(self, value): 218 currencies = getUtility(IIkobaUtils).CURRENCIES 219 return currencies[value][1] 220 207 221 class IIkobaUtils(Interface): 208 222 """A collection of methods which are subject to customization. -
main/waeup.ikoba/trunk/src/waeup/ikoba/products/productoptions.py
r12343 r12378 27 27 from zope.schema.fieldproperty import FieldProperty 28 28 from zope.schema import Object 29 from waeup.ikoba.interfaces import SimpleIkobaVocabulary29 from waeup.ikoba.interfaces import CurrencySource 30 30 from waeup.ikoba.interfaces import MessageFactory as _ 31 31 from waeup.ikoba.widgets.objectwidget import ( 32 32 IkobaObjectWidget, IkobaObjectDisplayWidget 33 33 ) 34 from waeup.ikoba.payments.currencies import ISO_4217_CURRENCIES_VOCAB as currencies35 34 36 #currencies = SimpleIkobaVocabulary(37 # (_('NGN'),'NGN'),38 # (_('USD'),'USD'),39 # (_('EUR'),'EUR'),40 # )41 35 42 36 class IProductOption(Interface): … … 54 48 currency = schema.Choice( 55 49 title = _(u'Currency'), 56 vocabulary = currencies,50 source = CurrencySource(), 57 51 required = False, 58 52 ) -
main/waeup.ikoba/trunk/src/waeup/ikoba/utils/utils.py
r12339 r12378 28 28 from waeup.ikoba.smtp import send_mail as send_mail_internally 29 29 from waeup.ikoba.utils.helpers import get_sorted_preferred 30 from waeup.ikoba.payments.currencies import ISO_4217_CURRENCIES 30 31 31 32 … … 95 96 'ig': (6, u'Igbo'), 96 97 } 98 99 # CURRENCIES must be equal to or an excerpt of ISO_4217_CURRENCIES 100 CURRENCIES = ISO_4217_CURRENCIES 97 101 98 102 #: A function to return
Note: See TracChangeset for help on using the changeset viewer.