summaryrefslogtreecommitdiffstats
path: root/engagements/admin.py
diff options
context:
space:
mode:
authorYulqen <246857+yulqen@users.noreply.github.com>2024-09-10 15:58:55 +0100
committerGitHub <noreply@github.com>2024-09-10 15:58:55 +0100
commitdcfe6d87098bbe064d2db268f0972865c3d412bf (patch)
tree2b82df07a5290f80f25e9780596cbce0f128454f /engagements/admin.py
parent7ddc22b821f405546786977225e7b194a19b2b77 (diff)
parent15b2dc965bfe2271d73476fcf9ff636c60113908 (diff)
Merge pull request #106 from defencedigital/postgres-migration
Adds new Engagement Strategy stuff
Diffstat (limited to 'engagements/admin.py')
-rw-r--r--engagements/admin.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/engagements/admin.py b/engagements/admin.py
index 9861867..3b9d05c 100644
--- a/engagements/admin.py
+++ b/engagements/admin.py
@@ -4,9 +4,11 @@ from .models import (
Engagement,
EngagementEffort,
EngagementType,
+ EngagementStrategy,
Organisation,
Person,
RegulatedEntityType,
+ RegulatoryCycle,
RegulatoryRole,
)
@@ -15,6 +17,10 @@ site = admin.site
site.site_header = "DefNucSyR Engagement Database (DED)"
+class EngagementStrategyAdmin(admin.ModelAdmin):
+ list_display = ("__str__", "owned_by")
+
+
class PersonAdmin(admin.ModelAdmin):
list_display = ("__str__", "organisation")
@@ -23,10 +29,21 @@ class PersonAdmin(admin.ModelAdmin):
return f"{obj.first_name} {obj.last_name}"
+class RegulatoryCycleAdmin(admin.ModelAdmin):
+ @admin.display(description="year")
+ def year(self, obj):
+ return f"{obj.get_year()}"
+
+ list_display = ("__str__", "year")
+ ordering = ("-start_date",)
+
+
site.register(Person, PersonAdmin)
site.register(Organisation)
site.register(RegulatedEntityType)
site.register(RegulatoryRole)
+site.register(RegulatoryCycle, RegulatoryCycleAdmin)
site.register(EngagementType)
+site.register(EngagementStrategy, EngagementStrategyAdmin)
site.register(Engagement)
site.register(EngagementEffort)