Django Using order_by with .annotate() and getting related field
问题 I have the following data, This query groups by topicid, and then in each group gets the max date, frequency of posts and counts the number of authors as contributors, info_model = InfoModel.objects.values('topicid') .annotate( max=Max('date'), freq=Count('postid'), contributors=Count('author', distinct=True)) This query can then be displayed as follows, Q.1 (SOLVED) How can I order the rows by date, from most recent down? I did appended .order_by('date') to the query, which seems like the