# HG changeset patch # User cavaliet # Date 1357645174 -3600 # Node ID 43a60bdffe6984925e534cdd5a354de3d28f4d9c # Parent 54b0ac8c4a1f65a6492c2dbf6cda657bd9e14cd8 correct sort in mashupbytag diff -r 54b0ac8c4a1f -r 43a60bdffe69 src/ldt/ldt/ldt_utils/views/json.py --- a/src/ldt/ldt/ldt_utils/views/json.py Mon Jan 07 17:01:02 2013 +0100 +++ b/src/ldt/ldt/ldt_utils/views/json.py Tue Jan 08 12:39:34 2013 +0100 @@ -163,7 +163,7 @@ current_weight = 1 # Now that we have the weight for all temporal segments, we just have to sort the array. - highest_weighted = sorted(highest_weighted, key=lambda x: (-x["weight"],x["title"])) + highest_weighted = sorted(highest_weighted, key=itemgetter("weight"), reverse=True) for res in highest_weighted: cur_in = res["start_ts"] cur_out = cur_in + res["duration"]