Merge remote-tracking branch 'origin/develop' into develop

This commit is contained in:
alex 2020-02-04 17:19:18 +03:00
commit 0c87e3cd25

View File

@ -2,6 +2,7 @@
from django.contrib.postgres.fields.jsonb import KeyTextTransform from django.contrib.postgres.fields.jsonb import KeyTextTransform
from rest_framework import generics, status from rest_framework import generics, status
from rest_framework.response import Response from rest_framework.response import Response
from rest_framework.views import APIView
from location import filters from location import filters
from location import models, serializers from location import models, serializers
@ -131,7 +132,7 @@ class CountryRUDView(CountryBaseViewMixin, generics.RetrieveUpdateDestroyAPIView
serializer_class = serializers.CountryBackSerializer serializer_class = serializers.CountryBackSerializer
class CountryCallingCodeListView(generics.ListAPIView): class CountryCallingCodeListView(APIView):
""" """
## Country codes view. ## Country codes view.
### Response ### Response
@ -166,6 +167,5 @@ class CountryCallingCodeListView(generics.ListAPIView):
### Description ### Description
Return an array of unique country code for all countries in a database. Return an array of unique country code for all countries in a database.
""" """
return Response(models.Country.objects.only('calling_code') return Response(data=models.Country.objects.aggregate_country_codes(),
.aggregate_country_codes(),
status=status.HTTP_200_OK) status=status.HTTP_200_OK)