add GeometryField and features api endpoint
This commit is contained in:
parent
de35a20854
commit
e6cbe5bf27
8 changed files with 100 additions and 5 deletions
|
@ -1,9 +1,10 @@
|
|||
from django.http import Http404
|
||||
from rest_framework.response import Response
|
||||
from rest_framework.viewsets import ViewSet
|
||||
from rest_framework.viewsets import ModelViewSet, ViewSet
|
||||
|
||||
from ...editor.hosters import hosters
|
||||
from ..serializers import HosterSerializer
|
||||
from ...mapdata.models import Feature
|
||||
from ..serializers import FeatureSerializer, HosterSerializer
|
||||
|
||||
|
||||
class HosterViewSet(ViewSet):
|
||||
|
@ -19,3 +20,12 @@ class HosterViewSet(ViewSet):
|
|||
raise Http404
|
||||
serializer = HosterSerializer(hosters[pk], context={'request': request})
|
||||
return Response(serializer.data)
|
||||
|
||||
|
||||
class FeatureViewSet(ModelViewSet):
|
||||
"""
|
||||
Get all Map Features including ones that are only part of the current session
|
||||
"""
|
||||
queryset = Feature.objects.all()
|
||||
serializer_class = FeatureSerializer
|
||||
lookup_value_regex = '[^/]+'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue