In template for now I am using this:
{% for item in mydict|dictsortreversed:"column1" %}
But I have to sort data by two columns - is there any option in dictsort to do this? Or any alternative to do this in template?
As you can see in the Django code, there is no support for this.
However, since Python sorts in a stable way. This is trivial to implement by sorting twice :)
{% for item in mydict|dictsortreversed:"column1"|dictsortreversed:"column2" %}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With