summaryrefslogtreecommitdiffstats
path: root/engagements/admin.py
diff options
context:
space:
mode:
authorMatthew Lemon <y@yulqen.org>2024-04-23 11:16:38 +0100
committerMatthew Lemon <y@yulqen.org>2024-04-23 11:16:38 +0100
commit0f951dcf029d4af284467543a3afdf5bf6581a20 (patch)
treea48384210cdc168e3bd3ccff6d6d516eeed9e748 /engagements/admin.py
parent8b084e9fe7a5f3a04c32daf9a24f7f2cf67300f9 (diff)
switched to Django
Diffstat (limited to 'engagements/admin.py')
-rw-r--r--engagements/admin.py32
1 files changed, 32 insertions, 0 deletions
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)