From 0f951dcf029d4af284467543a3afdf5bf6581a20 Mon Sep 17 00:00:00 2001 From: Matthew Lemon Date: Tue, 23 Apr 2024 11:16:38 +0100 Subject: switched to Django --- engagements/admin.py | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 engagements/admin.py (limited to 'engagements/admin.py') diff --git a/engagements/admin.py b/engagements/admin.py new file mode 100644 index 0000000..9861867 --- /dev/null +++ b/engagements/admin.py @@ -0,0 +1,32 @@ +from django.contrib import admin + +from .models import ( + Engagement, + EngagementEffort, + EngagementType, + Organisation, + Person, + RegulatedEntityType, + RegulatoryRole, +) + +site = admin.site + +site.site_header = "DefNucSyR Engagement Database (DED)" + + +class PersonAdmin(admin.ModelAdmin): + list_display = ("__str__", "organisation") + + @admin.display(description="fullname") + def fullname(self, obj): + return f"{obj.first_name} {obj.last_name}" + + +site.register(Person, PersonAdmin) +site.register(Organisation) +site.register(RegulatedEntityType) +site.register(RegulatoryRole) +site.register(EngagementType) +site.register(Engagement) +site.register(EngagementEffort) -- cgit v1.2.3