From 1ec537f9bb9e63dd20ddf5d3666da32c5f311309 Mon Sep 17 00:00:00 2001 From: Umayanga Date: Sun, 17 Nov 2019 10:12:08 +0530 Subject: [PATCH] final report sort DESC --- .../TallySheetVersion_PRE_ALL_ISLAND_RESULT.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/orm/entities/SubmissionVersion/TallySheetVersion/TallySheetVersion_PRE_ALL_ISLAND_RESULT.py b/orm/entities/SubmissionVersion/TallySheetVersion/TallySheetVersion_PRE_ALL_ISLAND_RESULT.py index 55518e25..09939027 100644 --- a/orm/entities/SubmissionVersion/TallySheetVersion/TallySheetVersion_PRE_ALL_ISLAND_RESULT.py +++ b/orm/entities/SubmissionVersion/TallySheetVersion/TallySheetVersion_PRE_ALL_ISLAND_RESULT.py @@ -11,6 +11,7 @@ from orm.enums import TallySheetCodeEnum, AreaTypeEnum from sqlalchemy import and_ from datetime import datetime +import operator class TallySheetVersion_PRE_ALL_ISLAND_RESULT_Model(TallySheetVersion.Model): @@ -203,6 +204,7 @@ def get_html_content_dict(self): to_percentage(candidate_wise_valid_vote_count_result_item.validVotePercentage) ]) + content['data'] = sorted(content['data'], key=operator.itemgetter(2), reverse=True) content["validVoteCounts"] = [ to_comma_seperated_num(vote_count_result["validVoteCount"]), to_percentage(vote_count_result["validVoteCountPercentage"])