Open TITANHACKY opened 1 year ago
@TITANHACKY How did you go about solving this problem? More importantly, I was hoping to be able to sort by a sum of values
Hi @elementace,
I had modified get_initial_queryset and queried the data using annotate method and calculated the sum, count
Thanks @TITANHACKY , for completion sake; I did it in the filter queryset method, to save in some extra compute.
Nice
Currently there is no aggreate values for m2m_foreign_field like count, sum. If there is aggregate values then there is no need to write initial query set