Re: Ordering by ManyToManyField length

2008-09-07 Thread Russell Keith-Magee
On Sun, Sep 7, 2008 at 1:04 PM, Jarred Bishop <[EMAIL PROTECTED]> wrote: > > Hello. How would I do this? > > Say I have a model 'Tag' that has a ManyToManyField called 'entries', > can I order a query by total entries? > > something like this is how I imagine it would work: > Tag.objects.all().ord

Ordering by ManyToManyField length

2008-09-06 Thread Jarred Bishop
Hello. How would I do this? Say I have a model 'Tag' that has a ManyToManyField called 'entries', can I order a query by total entries? something like this is how I imagine it would work: Tag.objects.all().order_by("entries.count") but I cannot find a proper example. Thanks for your help. --~--