Skip to content

Commit b293470

Browse files
committed
adding a list() method of the viewset
1 parent 4182bd1 commit b293470

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

geonode/metadata/api/views.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,15 @@ class MetadataViewSet(ViewSet):
5353

5454
queryset = ResourceBase.objects.all()
5555

56-
def list(self, request):
57-
pass
56+
def list(self, request, *args, **kwargs):
57+
base = request.build_absolute_uri("").rstrip("/")
58+
return Response(
59+
{
60+
"message": "Available metadata endpoints",
61+
"schema": f"{base}/schema/",
62+
"instance": f"{base}/instance/<pk>/",
63+
}
64+
)
5865

5966
# Get the JSON schema
6067
# A pk argument is set for futured multiple schemas

0 commit comments

Comments
 (0)