From dae1a5419e1e214a2c77ee49976d5b81901b1ff7 Mon Sep 17 00:00:00 2001 From: KK Date: Thu, 11 Jan 2024 17:33:30 +0100 Subject: [PATCH] refactor: use model verbose names in property table Switch from class name to verbose name + capitalise strings instead of title-casing them. --- apis_core/apis_relations/tables.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apis_core/apis_relations/tables.py b/apis_core/apis_relations/tables.py index 2812dad12..89cb905cf 100644 --- a/apis_core/apis_relations/tables.py +++ b/apis_core/apis_relations/tables.py @@ -70,7 +70,7 @@ class PropertyTable(tables.Table): "model" ), # order retrieved objects within table cell # use .name for model verbose name, .model for model class name - transform=lambda ent: f"{ent.model.title()}", + transform=lambda ent: f"{ent.name.capitalize()}", linkify_item={ "viewname": "apis_core:apis_entities:generic_entities_list", "args": [tables.A("model")], @@ -86,7 +86,7 @@ class PropertyTable(tables.Table): "model" ), # order retrieved objects within table cell # use .name for model verbose name, .model for model class name - transform=lambda ent: f"{ent.model.title()}", + transform=lambda ent: f"{ent.name.capitalize()}", linkify_item={ "viewname": "apis_core:apis_entities:generic_entities_list", "args": [tables.A("model")],