From 5fb0621c53967bf24f4411f579712223e96b296a Mon Sep 17 00:00:00 2001 From: Matthew Lemon Date: Tue, 10 Sep 2024 12:11:12 +0100 Subject: Adds RegulatoryCycle model --- engagements/admin.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'engagements/admin.py') diff --git a/engagements/admin.py b/engagements/admin.py index 9861867..5c582ee 100644 --- a/engagements/admin.py +++ b/engagements/admin.py @@ -7,6 +7,7 @@ from .models import ( Organisation, Person, RegulatedEntityType, + RegulatoryCycle, RegulatoryRole, ) @@ -23,10 +24,20 @@ 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(Engagement) site.register(EngagementEffort) -- cgit v1.2.3 From 15eceda8c762c3e3890f2c160d1c89c36a7b398b Mon Sep 17 00:00:00 2001 From: Matthew Lemon Date: Tue, 10 Sep 2024 14:08:35 +0100 Subject: ES basically done --- engagements/admin.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'engagements/admin.py') diff --git a/engagements/admin.py b/engagements/admin.py index 5c582ee..3b9d05c 100644 --- a/engagements/admin.py +++ b/engagements/admin.py @@ -4,6 +4,7 @@ from .models import ( Engagement, EngagementEffort, EngagementType, + EngagementStrategy, Organisation, Person, RegulatedEntityType, @@ -16,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") @@ -39,5 +44,6 @@ site.register(RegulatedEntityType) site.register(RegulatoryRole) site.register(RegulatoryCycle, RegulatoryCycleAdmin) site.register(EngagementType) +site.register(EngagementStrategy, EngagementStrategyAdmin) site.register(Engagement) site.register(EngagementEffort) -- cgit v1.2.3