geonode.documents.api.views

Attributes

logger

Classes

DocumentViewSet

API endpoint that allows documents to be viewed or edited.

Module Contents

geonode.documents.api.views.logger[source]
class geonode.documents.api.views.DocumentViewSet[source]

Bases: dynamic_rest.viewsets.DynamicModelViewSet

API endpoint that allows documents to be viewed or edited.

http_method_names = ['get', 'patch', 'put', 'post'][source]
authentication_classes[source]
permission_classes[source]
filter_backends[source]
queryset[source]
serializer_class[source]
pagination_class[source]
perform_create(serializer)[source]

Function to create document via API v2. file_path: path to the file doc_file: the open file

The API expect this kind of JSON:

{
    "document": {
        "title": "New document",
        "metadata_only": true,
        "file_path": "/home/mattia/example.json"
    }
}

File path rappresent the filepath where the file to upload is saved.

or can be also a form-data:

curl --location --request POST 'http://localhost:8000/api/v2/documents' \
--form 'title="Super Title2"' \
--form 'doc_file=@"/C:/Users/user/Pictures/BcMc-a6T9IM.jpg"' \
--form 'metadata_only="False"'
linked_resources(request, pk=None, *args, **kwargs)[source]