14 lines
466 B
Python
14 lines
466 B
Python
from rest_framework.response import Response
|
|
from rest_framework.views import APIView
|
|
|
|
from company.models.location import LocationCode
|
|
from company.serializers.location import LocationSerializer
|
|
|
|
|
|
class LocationCodeApi(APIView):
|
|
"""View for return location list"""
|
|
|
|
def get(self, request, *args, **kwargs) -> Response:
|
|
locations = LocationCode.objects.all()
|
|
data = LocationSerializer(locations, many=True).data
|
|
return Response(data)
|