aboutsummaryrefslogtreecommitdiffstats
path: root/ctrack/organisations
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--ctrack/organisations/admin.py16
-rw-r--r--ctrack/organisations/models.py3
2 files changed, 18 insertions, 1 deletions
diff --git a/ctrack/organisations/admin.py b/ctrack/organisations/admin.py
index 0a3827d..f85ddad 100644
--- a/ctrack/organisations/admin.py
+++ b/ctrack/organisations/admin.py
@@ -1,6 +1,15 @@
from django.contrib import admin
-from .models import Address, AddressType, Mode, Organisation, Person, Role, Submode
+from .models import (
+ Address,
+ AddressType,
+ Mode,
+ Organisation,
+ Person,
+ Role,
+ Stakeholder,
+ Submode,
+)
# So we can get the organisation name - a reverse lookup
@@ -16,6 +25,10 @@ class AddressTypeAdmin(admin.ModelAdmin):
pass
+class StakeholderAdmin(admin.ModelAdmin):
+ model = Stakeholder
+
+
class AddressInLine(admin.StackedInline):
model = Address
max_num = 3
@@ -58,3 +71,4 @@ admin.site.register(Role, RoleAdmin)
admin.site.register(Person, PersonAdmin)
admin.site.register(Mode, ModeAdmin)
admin.site.register(Submode, SubmodeAdmin)
+admin.site.register(Stakeholder, StakeholderAdmin)
diff --git a/ctrack/organisations/models.py b/ctrack/organisations/models.py
index 92e4bc6..6a1b4ac 100644
--- a/ctrack/organisations/models.py
+++ b/ctrack/organisations/models.py
@@ -178,3 +178,6 @@ class Address(models.Model):
class Stakeholder(models.Model):
person = models.ForeignKey(Person, on_delete=models.CASCADE)
+
+ def __str__(self):
+ return f"{self.person.first_name} {self.person.last_name}"