query in annotate

8 views
Skip to first unread message

vitans...@collegedekho.com

unread,
Aug 19, 2018, 8:04:38 AM8/19/18
to Django users
In [2]: Review.objects.values('description','user','review_type','reviewmapping_
   ...: _insitute').annotate(Count('description','user')).annotate(Count('review
   ...: _type','reviewmapping__insitute')).count()
Out[2]: 2720

I want ids of these for filter reviews
for this I use

In [3]: Review.objects.values('description','user','review_type','reviewmapping_
   ...: _insitute').annotate(Count('description','user')).annotate(Count('review
   ...: _type','reviewmapping__insitute')).values_list('id').count()
Out[3]: 5139

this give id of total objects

Reply all
Reply to author
Forward
0 new messages