16.9.2011 15:27, dave bl kirjoitti:
Hmm no I am not missing the point... I think the django devs are...
sqlalchemy _has_ a group by.

So I simply want to do this sql statement(using the django orm):

select foo, count(foo), from bar group by foo;

I _could_ use a .extra method to do this(and get stuck on $databases)
... or a loop... (non-sql). IMHO I should be able to do it via the
orm. If you can do it via the orm - how do I do it ?


Bar.objects.values('foo').annotate(Count('foo'))

As written in Django documentation...

--

Jani Tiainen

--
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