Browse Source

Fix řadit (Node) jako poslední

export_seznamu_prednasek
Jonas Havelka 3 years ago
parent
commit
adc0c68977
  1. 4
      mamweb/admin.py

4
mamweb/admin.py

@ -38,11 +38,11 @@ def get_app_list(self, request):
app_dict = self._build_app_dict(request)
# 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.
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

Loading…
Cancel
Save