Skip to content

Commit

Permalink
feat(generic): add getter for api detail endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
b1rger committed May 16, 2024
1 parent 93213f9 commit 3c80aef
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions apis_core/generic/abc.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 3c80aef

Please sign in to comment.