Skip to content

Commit

Permalink
add Django support
Browse files Browse the repository at this point in the history
  • Loading branch information
tomkralidis committed Dec 31, 2024
1 parent ae8d245 commit a5c7c73
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
10 changes: 10 additions & 0 deletions pygeoapi/django_/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,16 @@ def apply_slash_rule(url: str):
views.get_collection_edr_query,
name='collection-edr-corridor',
),
path(
'collections/<str:collection_id>/instances/<str:instance_id>',
views.get_collection_edr_query,
name='collection-edr-instance',
),
path(
'collections/<str:collection_id>/instances',
views.get_collection_edr_query,
name='collection-edr-instances',
),
path(
'collections/<str:collection_id>/instances/<str:instance_id>/position',
views.get_collection_edr_query,
Expand Down
8 changes: 8 additions & 0 deletions pygeoapi/django_/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,14 @@ def get_collection_edr_query(
:returns: Django HTTP response
"""

if (request.path.endswith('instances') or
(instance_id is not None and
request.path.endswith(instance_id))):
return execute_from_django(
edr_api.get_collection_edr_instances, request, collection_id,
instance_id
)

if location_id:
query_type = 'locations'
else:
Expand Down

0 comments on commit a5c7c73

Please sign in to comment.