diff options
author | Matthew Lemon <matt@matthewlemon.com> | 2020-09-02 11:35:59 +0100 |
---|---|---|
committer | Matthew Lemon <matt@matthewlemon.com> | 2020-09-02 11:35:59 +0100 |
commit | 6610509f3a3ceab151bc70305508892c9fe00e7b (patch) | |
tree | 6e2cf1283ddc679a223cd0ad0286b23f58988dd7 /ctrack/caf/admin.py | |
parent | 055b50d7675505d60c0faa8bea900c9e553b7f2b (diff) |
can now add a new system via the org user page
Diffstat (limited to 'ctrack/caf/admin.py')
-rw-r--r-- | ctrack/caf/admin.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/ctrack/caf/admin.py b/ctrack/caf/admin.py index f1aa860..5513781 100644 --- a/ctrack/caf/admin.py +++ b/ctrack/caf/admin.py @@ -10,13 +10,21 @@ from .models import ( ) +def get_system_org(obj): + es = obj.essentialservice_set.first() # just get the first if there are many + return es.organisation.name + + +get_system_org.short_description = "Organisation" + + class EssentialServiceAdmin(admin.ModelAdmin): model = EssentialService class ApplicableSystemListAdmin(admin.ModelAdmin): model = ApplicableSystem - list_display = ["name", "function"] + list_display = ["name", get_system_org, "function"] # FIXME |