Ticket #6904: dictsort.patch
File dictsort.patch, 805 bytes (added by , 17 years ago) |
---|
-
defaultfilters.py
418 418 """ 419 419 var_resolve = Variable(arg).resolve 420 420 decorated = [(var_resolve(item), item) for item in value] 421 decorated.sort() 421 import operator 422 decorated.sort(key=lambda x: unicode.lower(x[0])) 422 423 return [item[1] for item in decorated] 423 424 dictsort.is_safe = False 424 425 … … 429 430 """ 430 431 var_resolve = Variable(arg).resolve 431 432 decorated = [(var_resolve(item), item) for item in value] 432 decorated.sort() 433 import operator 434 decorated.sort(key=lambda x: unicode.lower(x[0])) 433 435 decorated.reverse() 434 436 return [item[1] for item in decorated] 435 437 dictsortreversed.is_safe = False