Skip to content

Commit

Permalink
Merge pull request #381 from umayangag/sort-final-result
Browse files Browse the repository at this point in the history
final report sort DESC
  • Loading branch information
dinukadesilva authored Nov 17, 2019
2 parents 5339e16 + 1ec537f commit 1038597
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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"])
Expand Down

0 comments on commit 1038597

Please sign in to comment.