Ignore:
Timestamp:
26 May 2014, 10:21:17 (10 years ago)
Author:
Henrik Bettermann
Message:

Sort ContextualDictSource? by dictionary values not by keys.

File:
1 edited

Legend:

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

    r11589 r11664  
    113113    def getValues(self, context):
    114114        utils = getUtility(IKofaUtils)
    115         return sorted(getattr(utils, self.DICT_NAME).keys())
     115        sorted_items = sorted(getattr(utils, self.DICT_NAME).items(),
     116                              key=lambda item: item[1])
     117        return [item[0] for item in sorted_items]
    116118
    117119    def getToken(self, context, value):
Note: See TracChangeset for help on using the changeset viewer.