feat(api): Add back url to metadata

ref: #410 #411
This commit is contained in:
2024-11-30 13:58:00 +09:30
parent e4ce1b539e
commit 4ae965603c
2 changed files with 23 additions and 0 deletions

View File

@ -82,6 +82,25 @@ class CommonViewSet(
view_name: str = None
def get_back_url(self) -> str:
"""Metadata Back URL
This URL is an optional URL that if required the view must
override this method. If the URL for a back operation
is not the models URL, then this method is used to return
the URL that will be used.
Defining this URL will predominatly be for sub-models. It's
recommended that the `reverse` function
(rest_framework.reverse.reverse) be used with a `request`
object.
Returns:
str: Full url in format `<protocol>://<doman name>.<tld>/api/<API version>/<model url>`
"""
return None
def get_model_documentation(self):