Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

.comments.all order django



from django.db.models import Count

posts = Post.objects.annotate(num_comments=Count('comment')).order_by('-num_comments')


Source by devarama.com #
 
PREVIOUS NEXT
Tagged: #order #django
ADD COMMENT
Topic
Name
5+8 =