[Fixed]-Updating model method during queryset list

1👍

“Can you run a function and order by the results of that function for each instance returned?”

Yes you can :).

def score_func(model):
    score = do_something_to_get_score(model)
    return score

results = sorted(list_of_models, score_func)

Leave a comment