From 0439491495476a17b2e2a8feca485a3bba748895 Mon Sep 17 00:00:00 2001 From: SDE Date: Fri, 21 Jul 2023 14:13:03 +0300 Subject: [PATCH] 0.0.35 change algo get_address_point_ajax --- ReferenceDataApp/js_views.py | 3 +++ templates/widgets/w_ac_input_address_point.html | 11 +++-------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/ReferenceDataApp/js_views.py b/ReferenceDataApp/js_views.py index f2fc67b..d1d1160 100644 --- a/ReferenceDataApp/js_views.py +++ b/ReferenceDataApp/js_views.py @@ -41,8 +41,11 @@ def get_address_point_ajax(request): res_data = search_cities_in_db(data['search_str']) res_data_str_list = [] + i = 0 for item in res_data: + item['index'] = i res_data_str_list.append(render_to_string('widgets/w_ac_input_address_point.html', item)) + i += 1 res_Dict = { 'res_search_list': res_data_str_list diff --git a/templates/widgets/w_ac_input_address_point.html b/templates/widgets/w_ac_input_address_point.html index 6b042a8..1a4cbf9 100644 --- a/templates/widgets/w_ac_input_address_point.html +++ b/templates/widgets/w_ac_input_address_point.html @@ -1,9 +1,4 @@ -
-
- -
-
+
+
{{ iata_code }} - {{ name }}
+
{{ city__name }}, {{ city__country__name }}
\ No newline at end of file