Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to perform group by with django orm

Transaction.objects.all().values('actor').annotate(total=Count('actor')).order_by('total')
Transaction.objects.all().values('actor').annotate(total=Count('id')).order_by('total')
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #perform #group #django #orm
ADD COMMENT
Topic
Name
5+2 =