geonode.harvesting.api.routers
Classes
A router that enables PATCH requests on the list endpoint. |
Module Contents
- class geonode.harvesting.api.routers.ListPatchRouter[source]
Bases:
rest_framework_extensions.routers.ExtendedSimpleRouterA router that enables PATCH requests on the list endpoint.
This router is designed to provide API endpoints that accept PATCH requests targeting a viewset’s list endpoint. It is useful for batch updates on multiple resources.
Use case example: Consider the scenario of selecting remote resources for harvesting by the local GeoNode:
The user views a (paginated) list of resources available on the remote service.
The user then selects which resources should be harvested.
Instead of requiring multiple PATCH requests for each individual resource’s detail page to update the should_be_harvested property, the user can make a single PATCH request to harvesters/{harvester-id}/harvestable-resources to update the should_be_harvested property on multiple resources simultaneously.