On Fri, May 15, 2009 at 12:48 PM, Marlun <martin.lundb...@gmail.com> wrote:

>
> Hello everyone,
>
> I've got a model called Entry which users can comment on using the
> django comment framework. Now I want to list the ten most popular
> entries so I need to order them by comment count.
>
> How do I order a query by comments connected to a model?
>
> -Martin
> >
>
If you are using the latest development version you can do this using
aggregates:

http://docs.djangoproject.com/en/dev/topics/db/aggregation/#order-by

Alex

-- 
"I disapprove of what you say, but I will defend to the death your right to
say it." --Voltaire
"The people's good is the highest law."--Cicero

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to