1👍
✅
try this:
BlogPost.objects.filter(q1 | q2).annotate(blog_times=Count('id')).order_by('blog_times')
Source:stackexchange.com
1👍
try this:
BlogPost.objects.filter(q1 | q2).annotate(blog_times=Count('id')).order_by('blog_times')