Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

count items in a model django rest

CustomerInformation.objects.annotate(lead_count=Count('status',filter=Q(status="lead"))).annotate(client_count=Count('status',filter=Q(status="client")))
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #count #items #model #django #rest
ADD COMMENT
Topic
Name
6+8 =