Let's say that I have a 'Scores' table with fields 'User','ScoreA', 'ScoreB', 'ScoreC'. In a leaderboard view I fetch and order a queryset by any one of these score fields that the visitor selects. The template paginates the queryset. The table is updated by a job on regular periods (a django command triggered by cron).
I want to add a 'rank' field to the queryset so that I will have 'rank', 'User', 'ScoreA', 'ScoreB', 'ScoreC'. Moreover I want to remain database-independent (postgre is an option and for the time being it does not support row_number).
A solution may be that I can modify the job, so that it also computes and writes three different ranks in three new fields ('rankA', 'rankB', 'rankC').
I hope there is a (much) better solution?