Add app model sorting for finance and alphabet sorting for others

This commit is contained in:
2025-01-29 23:05:04 +01:00
parent a7ee650729
commit c2b6dfa3e4

View File

@@ -74,6 +74,18 @@ def get_app_list(self, request, app_label=None):
}
app["models"].sort(key=lambda x: ordering[x["name"]])
elif app["app_label"] == "finance":
ordering = {
"Rechnungen": 1,
"Wiref Formulare": 2,
"Beschlüsse": 3,
"Bankdaten": 4,
}
app["models"].sort(key=lambda x: ordering[x["name"]])
else:
app["models"].sort(key=lambda x: x["name"])
return app_list