github.com/pyroscope-io/pyroscope@v0.37.3-0.20230725203016-5f6947968bd0/examples/python/rideshare/django/app/ride_share/views/scooter/scooter.py (about)

     1  from rest_framework.views import APIView
     2  from rest_framework.response import Response
     3  
     4  from ride_share.utility.utility import find_nearest_vehicle
     5  
     6  class ScooterView(APIView):
     7      """
     8      View to order a scooter
     9      """
    10      def order_scooter(self, search_radius):
    11          find_nearest_vehicle(search_radius, "scooter")
    12  
    13      def get(self, request, format=None):
    14          """
    15          Order a scooter within a certain radius.
    16          """
    17          self.order_scooter(0.3)
    18          return Response(["Scooter view"])