Hi, I want to sort objects based on computed value in django ... how to do this?
Here is an example of a stack overflow model of a user profile that explains my predicament:
class Profile(models.Model): user = models.ForeignKey(User) def get_reputation(): ... return reputation reputation = property(get_reputation)
So, let's say I want to sort users by reputation. How should I do it? I know that you cannot just do this:
Profile.objects.order_by("-reputation")
Thanks for all your help :)
python sorting django web-applications django-models
Jiaaro May 30 '09 at 11:34 p.m. 2009-05-30 23:34
source share