Skip to content
Snippets Groups Projects
Commit 0b4f435d authored by leufen1's avatar leufen1
Browse files

major roads service uses now the new CommonView class

parent 45cf5a4f
Branches lukas_issue017_refac_restrict-agg-functions
Tags
No related merge requests found
......@@ -4,13 +4,15 @@ from collections import OrderedDict
from rest_framework.views import APIView
from rest_framework.response import Response
from utils.views_commons import get_query_params
from utils.views_commons import CommonViews
from .overpass_api import OverpassRoadAPI
from .serializers import NearestSerializer, NearestDirectionSerializer, NearestByDirectionSerializer
class MajorRoadsView(APIView):
class MajorRoadsView(APIView, CommonViews):
def __init__(self):
CommonViews.__init__(self)
def get(self, request, format=None):
"""process GET requests for major-roads app
......@@ -34,7 +36,7 @@ class MajorRoadsView(APIView):
Default is motorway,trunk,primary,secondary.
For additional options see https://wiki.openstreetmap.org/wiki/Key:highway
"""
lat, lon, radius, direction, by_direction, highway_types = get_query_params(
lat, lon, radius, direction, by_direction, highway_types = self.get_query_params(
request.query_params,
['lat', 'lon', 'radius', 'direction', 'by_direction', 'highway_types'],
add_agg=False
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment