This commit is contained in:
Kovid Goyal 2021-10-28 21:22:50 +05:30
parent 1796385b34
commit 350ba190d4
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -127,6 +127,7 @@ def sort_key_for_name_and_first_letter(x):
return (c if numeric_collation and c.isdigit() else '9999999999', return (c if numeric_collation and c.isdigit() else '9999999999',
collation_order(v2), sort_key(v1)) collation_order(v2), sort_key(v1))
category_sort_keys = {True:{}, False: {}} category_sort_keys = {True:{}, False: {}}
category_sort_keys[True]['popularity'] = category_sort_keys[False]['popularity'] = \ category_sort_keys[True]['popularity'] = category_sort_keys[False]['popularity'] = \
lambda x:(-getattr(x, 'count', 0), sort_key(x.sort or x.name)) lambda x:(-getattr(x, 'count', 0), sort_key(x.sort or x.name))