From 3c80aefefbab436ee294cbc0d6b27f9aa8176df2 Mon Sep 17 00:00:00 2001 From: Birger Schacht Date: Wed, 15 May 2024 16:39:28 +0200 Subject: [PATCH] feat(generic): add getter for api detail endpoint --- apis_core/generic/abc.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/apis_core/generic/abc.py b/apis_core/generic/abc.py index 53daf8593..975e8e7e8 100644 --- a/apis_core/generic/abc.py +++ b/apis_core/generic/abc.py @@ -32,6 +32,10 @@ def get_create_success_url(self): def get_update_success_url(self): return self.get_edit_url() + def get_api_detail_endpoint(self): + ct = ContentType.objects.get_for_model(self) + return reverse("apis_core:generic:genericmodelapi-detail", args=[ct, self.id]) + @classmethod def get_change_permission(self): return permission_fullname("change", self)