summaryrefslogtreecommitdiffstats
path: root/engagements/admin.py
blob: 986186796f3f036b37dfd1b22e19a6f76b19ef67 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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)