On Tue, May 13, 2014 at 11:04 PM, Anthony <[email protected]> wrote:
> Basically when a queryset like
> instance.annotate(totals=Count('item_description')[:3] like
> PC 10
> Mac 7
> Mouse 5
> Keyboard 4
>
> I want to combine PC and Mac as say: Desktop so the results become
>
> Desktop 17
> Mac 7
> Mouse 5
> Keyboard 4
> Scanner 3
>
> Ant

Ah right I see, for some reason I didn't get the 'CASE WHEN' reference
in subject, on the same page now.

However, I have to say sorry - this feature isn't in the ORM as far as I know.

The ORM isn't supposed to replace SQL for every query, since
generating a less complex language to replace SQL entirely is an
exercise in futility - once you have all the features, your new
language is no less complex than the original. I guess this is one
such case.

Cheers

Tom

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAFHbX1%2BFonHK4fuDUSaRbPd6%3DsWDVsisjYs%2BhUMZR7HhA60a2A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to