Django:重新组合标签,按“计数”排序?

时间:2014-08-29 09:57:39

标签: python django

如何按集合中的成员数量订购重组?

我想做这样的事情:

{% regroup object.user.followed_by.all|dictsort:"profile_type.name.count" by profile_type.name as follower_list %}

......但它不起作用。

(本文值得阅读上下文:http://blog.ionelmc.ro/2013/10/26/django-dictsort-template-tag/ tl; dr“distsort”可以传递方法)

非常感谢!

0 个答案:

没有答案
相关问题