DEV Community

Muthu mani
Muthu mani

Posted on

Efficient way of rank update based on points

User_team=User_team.objects.filter().values(),

User_team=[{team_id:1, points:50},{team_id:2, points:30},{team_id:3, points:70}]

I already migrate New model and key is (rank,point) stored rank and points in this model.

User_team_event=User_team_event.objects.filter().values().
I'm expecting answer is without using loops:

User_team_event=[{team_id:3,rank:1, points:70},{team_id:1,rank:2, points:50},{team_id:2, points:30}]

Top comments (0)