Ticket #11008: dictsort.diff
File dictsort.diff, 821 bytes (added by , 16 years ago) |
---|
-
django/template/defaultfilters.py
469 469 """ 470 470 var_resolve = Variable(arg).resolve 471 471 decorated = [(var_resolve(item), item) for item in value] 472 decorated.sort( )472 decorated.sort(lambda lhs, rhs: cmp(lhs[0], rhs[0])) 473 473 return [item[1] for item in decorated] 474 474 dictsort.is_safe = False 475 475 … … 480 480 """ 481 481 var_resolve = Variable(arg).resolve 482 482 decorated = [(var_resolve(item), item) for item in value] 483 decorated.sort() 484 decorated.reverse() 483 decorated.sort(lambda lhs, rhs: -cmp(lhs[0], rhs[0])) 485 484 return [item[1] for item in decorated] 486 485 dictsortreversed.is_safe = False 487 486