correct sort in mashupbytag
authorcavaliet
Tue, 08 Jan 2013 12:39:34 +0100
changeset 1055 43a60bdffe69
parent 1054 54b0ac8c4a1f
child 1056 4edd2744637c
correct sort in mashupbytag
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"]