diff --git a/fantasy_app/functions.py b/fantasy_app/functions.py index f367ac4..2d336b6 100644 --- a/fantasy_app/functions.py +++ b/fantasy_app/functions.py @@ -170,6 +170,10 @@ def get_most_position_points(position, currentweek=0): def order_positions_by_points(score_list): sorted_list = sorted(score_list, key=operator.itemgetter( 'total_score'), reverse=True) + + for i, member_dict in enumerate(sorted_list): + member_dict["rank"] = i + 1 + # member_dict["rank"] = position + 1 return sorted_list