|
|
|
@ -101,7 +101,7 @@ def search_city(request): |
|
|
|
qs = City.objects.language().filter(country=country)[:200] |
|
|
|
qs = City.objects.language().filter(country=country)[:200] |
|
|
|
else: |
|
|
|
else: |
|
|
|
qs = City.objects.language().filter(country=country, translations__name__contains=term) |
|
|
|
qs = City.objects.language().filter(country=country, translations__name__contains=term) |
|
|
|
result = [{'id': city.id, 'label': city.name} for city in qs] |
|
|
|
result = list(set([{'id': city.id, 'label': city.name} for city in qs])) |
|
|
|
return JsonResponse(json.dumps(result), content_type='application/json', safe=False) |
|
|
|
return JsonResponse(json.dumps(result), content_type='application/json', safe=False) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|