Skip to content

Commit

Permalink
add query params to metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
csae8092 committed Dec 10, 2024
1 parent 9e4722c commit e001571
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions network/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ class EdgeListViews(GenericListView):


def edges_as_geojson(request):
query_params = request.GET
values_list = [x.name for x in Edge._meta.get_fields()]
qs = (
Edge.objects.filter(edge_kind__icontains="place")
Expand All @@ -76,6 +77,9 @@ def edges_as_geojson(request):
)
data = df_to_geojson_vect(df, ["label", "edge_id"])
data["metadata"] = {"number of objects": len(df)}
data["metadata"]["query_params"] = [
{key: value} for key, value in query_params.items()
]
return JsonResponse(data=data)


Expand Down

0 comments on commit e001571

Please sign in to comment.