From 3c0136d8bbffa0254f1908b4a1e8e1b51ecf2ad4 Mon Sep 17 00:00:00 2001 From: Birger Schacht Date: Wed, 25 Sep 2024 10:10:07 +0200 Subject: [PATCH] refactor(apis_relations): use `get_listview_url` for linkifying column --- apis_core/apis_relations/tables.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/apis_core/apis_relations/tables.py b/apis_core/apis_relations/tables.py index 206c0c870..b113be0ec 100644 --- a/apis_core/apis_relations/tables.py +++ b/apis_core/apis_relations/tables.py @@ -25,10 +25,7 @@ def __init__(self, *args, **kwargs): kwargs["orderable"] = True kwargs["filter"] = lambda qs: qs.order_by("model") kwargs["transform"] = lambda ent: f"{ent.name.capitalize()}" - kwargs["linkify_item"] = { - "viewname": "apis_core:apis_entities:generic_entities_list", - "args": [tables.A("model")], - } + kwargs["linkify_item"] = lambda record: record.model_class().get_listview_url() super().__init__(*args, **kwargs)