From c2b6dfa3e4532bd6e49730614d78110701f286b5 Mon Sep 17 00:00:00 2001 From: Patrick Mayr Date: Wed, 29 Jan 2025 23:05:04 +0100 Subject: [PATCH] Add app model sorting for finance and alphabet sorting for others --- fet2020/core/admin.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/fet2020/core/admin.py b/fet2020/core/admin.py index 1e64fa95..042231e1 100644 --- a/fet2020/core/admin.py +++ b/fet2020/core/admin.py @@ -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