You need to look at SQL aggregates. See here -
http://docs.djangoproject.com/en/dev/topics/db/aggregation/
On 25 August 2010 14:44, Joel Klabo wrote:
> I am trying to find a way to get a list of users ranked by the most
> "drinks". The drink model has a User field so I am doing this to get
> the
I am trying to find a way to get a list of users ranked by the most
"drinks". The drink model has a User field so I am doing this to get
the info, based on the Drink model:
http://dpaste.com/hold/233600/
But, this seems like craziness. Can't I just search the
User.objects.all().order_by('drinks')
2 matches
Mail list logo