From bb774bc2c968ae97922434aa4ce99d680e71c06d Mon Sep 17 00:00:00 2001 From: Jon Date: Thu, 29 May 2025 13:49:23 +0930 Subject: [PATCH] feat(core): Interim ViewSet for model CenturionNotes ref: #776 #778 --- app/core/viewsets/centurion_model_notes.py | 49 ++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 app/core/viewsets/centurion_model_notes.py diff --git a/app/core/viewsets/centurion_model_notes.py b/app/core/viewsets/centurion_model_notes.py new file mode 100644 index 00000000..9ca5cf45 --- /dev/null +++ b/app/core/viewsets/centurion_model_notes.py @@ -0,0 +1,49 @@ +from drf_spectacular.utils import ( + extend_schema, + extend_schema_view, + # OpenApiParameter, + # OpenApiResponse, + # PolymorphicProxySerializer +) + +from api.viewsets.common import SubModelViewSet_ReWrite + +from core.models.centurion_notes import CenturionModelNote + + + +class ViewSet( + SubModelViewSet_ReWrite +): + + base_model = CenturionModelNote + + filterset_fields = [ + 'content_type', + 'organization', + 'created_by', + 'modified_by', + ] + + model_kwarg = 'model_name' + + model_suffix = 'centurionmodelnote' + + search_fields = [ + 'body', + ] + + view_description = 'Centurion Model Notes' + + + +@extend_schema_view( # prevent duplicate documentation of both /access/entity endpoints + create = extend_schema(exclude = True), + destroy = extend_schema(exclude = True), + list = extend_schema(exclude = True), + retrieve = extend_schema(exclude = True), + update = extend_schema(exclude = True), + partial_update = extend_schema(exclude = True), +) +class NoDocsViewSet( ViewSet ): + pass