r4fek / django-cassandra-engine

Django Cassandra Engine - the Cassandra backend for Django
BSD 2-Clause "Simplified" License
365 stars 84 forks source link

How to do group_by? #73

Closed pcompassion closed 8 years ago

pcompassion commented 8 years ago

I'd like to do something like Player.objects.values('player_type', 'team').order_by().annotate(Count('player_type'), Count('team'))

It seems like group by is coming to cassandra soon https://issues.apache.org/jira/browse/CASSANDRA-10707

Is there a way to use CQL and map the results to queryset-like objects in django-cassandra-engine when group_by is added to cassandra?

(of course using the same values, annotate, Sum as in the above example would be best, but I dobut it's currently possible)

r4fek commented 8 years ago

Hi @pcompassion! You should probably ask this question here: https://github.com/datastax/python-driver