@ -90,6 +90,10 @@ class ReactUIMetadata(OverRideJSONAPIMetadata):
|
||||
|
||||
metadata['urls'].update({'self': url_self})
|
||||
|
||||
if view.get_back_url():
|
||||
|
||||
metadata['urls'].update({'back': view.get_back_url()})
|
||||
|
||||
if view.get_return_url():
|
||||
|
||||
metadata['urls'].update({'return_url': view.get_return_url()})
|
||||
|
@ -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):
|
||||
|
||||
|
Reference in New Issue
Block a user