-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* GeoContext keys management * Add select native layers * Keep location context group name
- Loading branch information
1 parent
50373a6
commit 2624b70
Showing
10 changed files
with
566 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import json | ||
|
||
from rest_framework import serializers | ||
from rest_framework.response import Response | ||
from rest_framework.views import APIView | ||
|
||
from cloud_native_gis.models import Layer | ||
|
||
|
||
class CloudNativeLayerSerializer(serializers.ModelSerializer): | ||
|
||
attributes = serializers.SerializerMethodField() | ||
|
||
def get_attributes(self, obj: Layer): | ||
return obj.attribute_names | ||
|
||
class Meta: | ||
model = Layer | ||
fields = [ | ||
'id', 'unique_id', | ||
'name', 'abstract', | ||
'attributes', 'default_style' | ||
] | ||
|
||
|
||
class CloudNativeLayerList(APIView): | ||
"""API for listing all cloud native layers.""" | ||
|
||
def get(self, request, *args): | ||
layers = Layer.objects.all() | ||
layers_data = CloudNativeLayerSerializer( | ||
layers, | ||
many=True | ||
).data | ||
return Response( | ||
layers_data | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.