Fix řadit (Node) jako poslední

This commit is contained in:
Jonas Havelka 2021-11-16 10:14:16 +01:00
parent e90cc4e6b3
commit adc0c68977

View file

@ -38,11 +38,11 @@ def get_app_list(self, request):
app_dict = self._build_app_dict(request) app_dict = self._build_app_dict(request)
# Sort the apps alphabetically. # Sort the apps alphabetically.
app_list = sorted(app_dict.values(), key=lambda x: locale.strxfrm('0') if (x['name'] == "Seminar") else locale.strxfrm(x['name'].lower())) app_list = sorted(app_dict.values(), key=lambda x: locale.strxfrm('!') if (x['name'] == "Seminar") else locale.strxfrm(x['name'].lower()))
# Sort the models alphabetically within each app. # Sort the models alphabetically within each app.
for app in app_list: for app in app_list:
app['models'].sort(key=lambda x: locale.strxfrm(x['name'].lower())) app['models'].sort(key=lambda x: locale.strxfrm('žž' + x['name'].lower()) if (x['name'].endswith("(Node)")) else locale.strxfrm(x['name'].lower()))
return app_list return app_list