lang = request.GET['lang'] if 'lang' ∈ request.GET and request.GET['lang'] is ¬ None else translation.get_language()
if lang ≡ 'ru':
queryset = City.objects.filter(
country=request.GET['country'],
city_name_ru__istartswith=request.GET['city']
)
elif lang ≡ 'uk':
queryset = City.objects.filter(
country=request.GET['country'],
city_name_uk__istartswith=request.GET['city']
)
elif lang ≡ 'be':
queryset = City.objects.filter(
country=request.GET['country'],
city_name_be__istartswith=request.GET['city']
)
page = self.paginate_queryset(queryset)
if page is ¬ None:
serializer = self.get_serializer(page, many=True)
data = self.update_data(request, serializer.data)
return self.get_paginated_response(data)
Что-то мне совсем не нравится как это выглядит