Lots of searching, found nothing so far.
In my django app, Model_X is rated by my users using a very standard ratings model. I have a standalone function that processes a LOT of data and when given a user instance, returns a list of tuples. The first value corresponds to the primary key for an instance of Model_X, and the second is the predicted rating. For example, it might return the following list of tuples.
[(1L, 5.25), (5L, 3.1), (23L, 1.83)]
I need to return a QuerySet (and it needs to be a QuerySet) of Model_X, containing only the instances listed in the tuples, sorted by these predicted ratings from the tuples.