diff options
Diffstat (limited to '')
-rw-r--r-- | ctrack/caf/admin.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/ctrack/caf/admin.py b/ctrack/caf/admin.py index ecdfd58..20e2b2a 100644 --- a/ctrack/caf/admin.py +++ b/ctrack/caf/admin.py @@ -14,12 +14,17 @@ class ApplicableSystemAdmin(admin.StackedInline): extra = 1 +def get_caf_name(obj): + ass = ApplicableSystem.objects.filter(caf=obj).first() + return f"{ass.organisation.name}_v{obj.version}" + + class CAFAdmin(admin.ModelAdmin): # TODO - we need the CAF list to show essential services # but this is a many-to-many relationship, so we need to summarise it somehow model = CAF inlines = [ApplicableSystemAdmin] - list_display = ["quality_grading", "confidence_grading", "file"] + list_display = [get_caf_name, "quality_grading", "confidence_grading", "file"] admin.site.register(CAF, CAFAdmin) |