From 814d5d88663bcaa20087d83c88ac470697965655 Mon Sep 17 00:00:00 2001 From: SDE Date: Fri, 21 Jul 2023 14:07:23 +0300 Subject: [PATCH] 0.0.34 change algo get_address_point_ajax --- ReferenceDataApp/js_views.py | 6 +++++- templates/blocks/profile/b_new_route.html | 4 ++-- templates/widgets/w_ac_input_address_point.html | 9 +++++++++ templates/widgets/w_autocomplete_input.html | 6 ------ 4 files changed, 16 insertions(+), 9 deletions(-) create mode 100644 templates/widgets/w_ac_input_address_point.html delete mode 100644 templates/widgets/w_autocomplete_input.html diff --git a/ReferenceDataApp/js_views.py b/ReferenceDataApp/js_views.py index a0dfab6..f2fc67b 100644 --- a/ReferenceDataApp/js_views.py +++ b/ReferenceDataApp/js_views.py @@ -40,8 +40,12 @@ def get_address_point_ajax(request): else: res_data = search_cities_in_db(data['search_str']) + res_data_str_list = [] + for item in res_data: + res_data_str_list.append(render_to_string('widgets/w_ac_input_address_point.html', item)) + res_Dict = { - 'data': list(res_data) + 'res_search_list': res_data_str_list } return JsonResponse(res_Dict) diff --git a/templates/blocks/profile/b_new_route.html b/templates/blocks/profile/b_new_route.html index a76a4dd..a4fb184 100644 --- a/templates/blocks/profile/b_new_route.html +++ b/templates/blocks/profile/b_new_route.html @@ -43,7 +43,7 @@
- {% include 'widgets/w_autocomplete_input.html' %} + {% include 'widgets/w_ac_input_address_point.html' %}
{% if form.errors and form.errors.from_address_point %} {{ form.errors.from_address_point}} @@ -54,7 +54,7 @@
- {% include 'widgets/w_autocomplete_input.html' %} + {% include 'widgets/w_ac_input_address_point.html' %}
{% if form.errors and form.errors.to_address_point %} {{ form.errors.to_address_point }} diff --git a/templates/widgets/w_ac_input_address_point.html b/templates/widgets/w_ac_input_address_point.html new file mode 100644 index 0000000..6b042a8 --- /dev/null +++ b/templates/widgets/w_ac_input_address_point.html @@ -0,0 +1,9 @@ +
+
+ +
+
+
\ No newline at end of file diff --git a/templates/widgets/w_autocomplete_input.html b/templates/widgets/w_autocomplete_input.html deleted file mode 100644 index df4c10b..0000000 --- a/templates/widgets/w_autocomplete_input.html +++ /dev/null @@ -1,6 +0,0 @@ -
-
- -
-
-
\ No newline at end of file