Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions documentcloud/addons/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ def domain_to_origin(value):
return f"{parsed.scheme}://{parsed.netloc}".lower()


@extend_schema(tags=["addons"])
class AddOnViewSet(viewsets.ModelViewSet):
serializer_class = AddOnSerializer
queryset = AddOn.objects.none()
Expand Down Expand Up @@ -508,6 +509,7 @@ class Meta:
filterset_class = Filter


@extend_schema(tags=["addon_runs"])
class AddOnRunViewSet(FlexFieldsModelViewSet):
serializer_class = AddOnRunSerializer
queryset = AddOnRun.objects.none()
Expand Down Expand Up @@ -816,6 +818,7 @@ class Meta:
filterset_class = Filter


@extend_schema(tags=["addon_events"])
class AddOnEventViewSet(FlexFieldsModelViewSet):
serializer_class = AddOnEventSerializer
queryset = AddOnEvent.objects.none()
Expand Down
3 changes: 3 additions & 0 deletions documentcloud/documents/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ def _max_updated_at(instances):
return max((obj.updated_at for obj in instances), default=None)


@extend_schema(tags=["documents"])
@method_decorator(conditional_cache_control(no_cache=True), name="dispatch")
@method_decorator(anonymous_cache_control, name="retrieve")
class DocumentViewSet(BulkModelMixin, FlexFieldsModelViewSet):
Expand Down Expand Up @@ -1407,6 +1408,7 @@ class Meta:
filterset_class = Filter


@extend_schema(tags=["document_sections"])
@method_decorator(conditional_cache_control(no_cache=True), name="dispatch")
class DocumentErrorViewSet(
mixins.CreateModelMixin, mixins.ListModelMixin, viewsets.GenericViewSet
Expand Down Expand Up @@ -1927,6 +1929,7 @@ def post_process(self, request, document_pk=None):
return Response("OK", status=status.HTTP_200_OK)


@extend_schema(tags=["saved_searches"])
class SavedSearchViewSet(viewsets.ModelViewSet):
serializer_class = SavedSearchSerializer
permission_classes = (IsAuthenticated,)
Expand Down
2 changes: 2 additions & 0 deletions documentcloud/entities/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
)


@extend_schema(tags=["entity"])
class EntityViewSet(BulkCreateModelMixin, viewsets.ModelViewSet):
serializer_class = EntitySerializer
queryset = Entity.objects.none()
Expand Down Expand Up @@ -207,6 +208,7 @@ class Meta:
filterset_class = Filter


@extend_schema(tags=["entity_occurrences"])
@method_decorator(conditional_cache_control(no_cache=True), name="dispatch")
class EntityOccurrenceViewSet(BulkCreateModelMixin, viewsets.ModelViewSet):
serializer_class = EntityOccurrenceSerializer
Expand Down
1 change: 1 addition & 0 deletions documentcloud/oembed/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
from documentcloud.oembed.registry import registry


@extend_schema(tags=["oembed"])
class OEmbedView(APIView):
"""The oembed endpoint responds with the appropriate code
allowing you to embed the resource (document, page, project, etc) on your website.
Expand Down
2 changes: 2 additions & 0 deletions documentcloud/organizations/stats_api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

# Third Party
from django_filters import rest_framework as django_filters
from drf_spectacular.utils import extend_schema

# DocumentCloud
from documentcloud.core.pagination import CursorPagination
Expand All @@ -23,6 +24,7 @@
)


@extend_schema(exclude=True)
class OrganizationStatsViewSet(
mixins.ListModelMixin,
mixins.RetrieveModelMixin,
Expand Down
1 change: 1 addition & 0 deletions documentcloud/organizations/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
)


@extend_schema(tags=["organizations"])
class OrganizationViewSet(viewsets.ReadOnlyModelViewSet):
serializer_class = OrganizationSerializer
permission_classes = [DjangoObjectPermissions]
Expand Down
1 change: 1 addition & 0 deletions documentcloud/projects/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ def _solr_set(document):
document.index_on_commit(field_updates=field_updates)


@extend_schema(tags=["projects"])
class ProjectViewSet(viewsets.ModelViewSet):
serializer_class = ProjectSerializer
queryset = Project.objects.none()
Expand Down
2 changes: 2 additions & 0 deletions documentcloud/users/stats_api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

# Third Party
from django_filters import rest_framework as django_filters
from drf_spectacular.utils import extend_schema

# DocumentCloud
from documentcloud.core.pagination import CursorPagination
Expand All @@ -22,6 +23,7 @@
from documentcloud.users.stats_api.serializers import UserStatsSerializer


@extend_schema(exclude=True)
class UserStatsViewSet(
mixins.ListModelMixin,
mixins.RetrieveModelMixin,
Expand Down
2 changes: 2 additions & 0 deletions documentcloud/users/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
from documentcloud.users.serializers import MessageSerializer, UserSerializer


@extend_schema(tags=["users"])
class UserViewSet(
# Cannot create or destroy users
FlexFieldsMixin,
Expand Down Expand Up @@ -188,6 +189,7 @@ class Meta:
filterset_class = Filter


@extend_schema(tags=["messages"])
class MessageView(APIView):
"""A view to allow you to email yourself via API"""

Expand Down
Loading