Thanks Dan. I was trying to avoid doing a custom query, but groupby
would work.

On Jul 24, 3:27 pm, Dan Lazewatsky <[EMAIL PROTECTED]> wrote:
> I'm not sure if there's anything built into Django to do this, but you
> should be able to accomplish it with a custom query and some crafty use
> of group by (http://www.w3schools.com/sql/sql_groupby.asp).
>
> -Dan
>
>
>
> Michael Trythall wrote:
>
> > Hello!
>
> > I'm trying to find a way to perform anorderbycount. For example, I
> > have a model called Item and in my DB I have 3 Item A's and 2 Item
> > B's. I'd like to submit a query that returns something like this:
>
> > Item A
> > Item A
> > Item A
> > Item B
> > Item B
>
> > Is this possible with Django? I haven't seen anything discussing such
> > functionality in the Django Database API doc. Would I have to write a
> > custom query to do this, and if so, does anyone have any suggestions
> > on getting started?
>
> > Thanks,
>
> > Michael
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to