On Monday 25 Jan 2010 3:25:51 pm Tomasz Zieliński wrote:
> > I have a model 'Player' and a Model 'Handicap'. Handicap will have
> > several fields, one of which is a foreign key to player. Now I need to
> > get the Handicap instance when the player had the highest handicap. I can
> > use Max to fin
model.objects.annotate(Max('handicap')).order_by('-handicap__max')
I think something like that does what you need.
Dougal
---
Dougal Matthews - @d0ugal
http://www.dougalmatthews.com/
2010/1/25 Kenneth Gonsalves
> hi,
>
> I have a model 'Player' and a Model 'Handicap'. Handicap will have sev
On 25 Sty, 07:38, Kenneth Gonsalves wrote:
> hi,
>
> I have a model 'Player' and a Model 'Handicap'. Handicap will have several
> fields, one of which is a foreign key to player. Now I need to get the
> Handicap
> instance when the player had the highest handicap. I can use Max to find the
> high
hi,
I have a model 'Player' and a Model 'Handicap'. Handicap will have several
fields, one of which is a foreign key to player. Now I need to get the Handicap
instance when the player had the highest handicap. I can use Max to find the
highest handicap and do a query to identify the instance wh
4 matches
Mail list logo