Ignore:
Timestamp:
3 Jan 2015, 13:41:03 (10 years ago)
Author:
Henrik Bettermann
Message:

Ease customization of courrencies. Use source instead of vocabulary in interfaces.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.ikoba/trunk/src/waeup/ikoba/interfaces.py

    r12343 r12378  
    205205        return value
    206206
     207class 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
    207221class IIkobaUtils(Interface):
    208222    """A collection of methods which are subject to customization.
Note: See TracChangeset for help on using the changeset viewer.