dso_api.dynamic_api.remote package
Logic for remote API endpoints.
The factory functions remote_serializer_factory()
and remote_viewset_factory()
can be imported directly from the top-level package.
Serializers
The serializer logic extends from the
DSOSerializer
and not DSOModelSerializer
.
The serializers mainly make sure the response is outputted in a DSO-compatible format.
- class dso_api.dynamic_api.remote.serializers.RemoteSerializer(*args, **kwargs)
Bases:
DSOSerializer
,_AuthMixin
Serializer that takes remote data
- dso_api.dynamic_api.remote.remote_serializer_factory(table_schema: DatasetTableSchema)
Generate the DRF serializer class for a specific dataset model.
Views
The remote views retrieve data from other REST API endpoints. Currently it mainly performs authorization, data retrieval, and schema validation.
- class dso_api.dynamic_api.remote.views.RemoteViewSet(**kwargs)
Bases:
DSOViewMixin
,ViewSet
Views for a remote serializer.
This viewset retrieves the data from a remote endpoint.
- dso_api.dynamic_api.remote.remote_viewset_factory(endpoint_url, serializer_class, table_schema: DatasetTableSchema) type[dso_api.dynamic_api.remote.views.RemoteViewSet]
Construct the viewset class that handles the remote serializer.