refactor(access): Update Entity model ViewSet attribute model_kwarg
to model_name
ref: #847 #840 #841 #842 #843 #845
This commit is contained in:
@ -65,7 +65,7 @@ def spectacular_request_serializers( serializer_type = 'Model'):
|
||||
description='.',
|
||||
parameters = [
|
||||
OpenApiParameter(
|
||||
name = 'entity_model',
|
||||
name = 'model_name',
|
||||
description = 'Enter the entity type. This is the name of the Entity sub-model.',
|
||||
location = OpenApiParameter.PATH,
|
||||
type = str,
|
||||
@ -106,7 +106,7 @@ def spectacular_request_serializers( serializer_type = 'Model'):
|
||||
description = '.',
|
||||
parameters =[
|
||||
OpenApiParameter(
|
||||
name = 'entity_model',
|
||||
name = 'model_name',
|
||||
description = 'Enter the entity type. This is the name of the Entity sub-model.',
|
||||
location = OpenApiParameter.PATH,
|
||||
type = str,
|
||||
@ -130,7 +130,7 @@ def spectacular_request_serializers( serializer_type = 'Model'):
|
||||
description='.',
|
||||
parameters = [
|
||||
OpenApiParameter(
|
||||
name = 'entity_model',
|
||||
name = 'model_name',
|
||||
description = 'Enter the entity type. This is the name of the Entity sub-model.',
|
||||
location = OpenApiParameter.PATH,
|
||||
type = str,
|
||||
@ -162,7 +162,7 @@ def spectacular_request_serializers( serializer_type = 'Model'):
|
||||
description='.',
|
||||
parameters = [
|
||||
OpenApiParameter(
|
||||
name = 'entity_model',
|
||||
name = 'model_name',
|
||||
description = 'Enter the entity type. This is the name of the Entity sub-model.',
|
||||
location = OpenApiParameter.PATH,
|
||||
type = str,
|
||||
@ -195,7 +195,7 @@ def spectacular_request_serializers( serializer_type = 'Model'):
|
||||
description = '.',
|
||||
parameters = [
|
||||
OpenApiParameter(
|
||||
name = 'entity_model',
|
||||
name = 'model_name',
|
||||
description = 'Enter the entity type. This is the name of the Entity sub-model.',
|
||||
location = OpenApiParameter.PATH,
|
||||
type = str,
|
||||
@ -233,7 +233,7 @@ class ViewSet(
|
||||
'organization',
|
||||
]
|
||||
|
||||
model_kwarg = 'entity_model'
|
||||
model_kwarg = 'model_name'
|
||||
|
||||
search_fields = [
|
||||
'model_notes',
|
||||
@ -254,7 +254,7 @@ class ViewSet(
|
||||
viewname = '_api_entity_sub-list',
|
||||
request = self.request,
|
||||
kwargs = {
|
||||
'entity_model': self.kwargs[self.model_kwarg],
|
||||
'model_name': self.kwargs[self.model_kwarg],
|
||||
}
|
||||
)
|
||||
|
||||
|
@ -30,7 +30,7 @@ class Index(IndexViewset):
|
||||
if self.request.feature_flag['2025-00002']:
|
||||
|
||||
response.update({
|
||||
"directory": reverse( 'v2:_api_entity_sub-list', request=request, kwargs = { 'entity_model': 'contact' } ),
|
||||
"directory": reverse( 'v2:_api_entity_sub-list', request=request, kwargs = { 'model_name': 'contact' } ),
|
||||
"entities": reverse( 'v2:_api_entity-list', request=request ),
|
||||
})
|
||||
|
||||
|
Reference in New Issue
Block a user