On Sun, 22 Jul 2007 21:59:56 -0500, James Bennett wrote: > On 7/22/07, Patrick <[EMAIL PROTECTED]> wrote: >> What would be the most efficient way to get 10 top authors using Django >> db-api? Or should I switch to raw SQL to handle this query? > > The most efficient way would be to use raw SQL. There are a couple > queries like that on djangosnippets.org to get top-rated snippets, > most-bookmarked snippets, etc., and you might want to look at those as > examples of how to do it: > > http://cab.googlecode.com/svn/trunk/managers.py > > The "most_bookmarked" method on the BookmarksManager, and the > "top_rated" method on the RatingsManager both do this sort of query.
Thanks for the link, James! I suspected SQL would be the winner here. I feel spoiled by Django ORM on a daily basis. --~--~---------~--~----~------------~-------~--~----~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---