0.11.20 push w link
This commit is contained in:
@@ -150,6 +150,16 @@ def get_routes_Dict(user=None, data=None):
|
||||
res_Dict = {}
|
||||
|
||||
if data:
|
||||
|
||||
type_transport = None
|
||||
if 'type_transport' in data and data['type_transport']:
|
||||
items_list = data['type_transport'].split(',')
|
||||
kwargs.update({f'type_transport__in': items_list})
|
||||
|
||||
if len(items_list) == 1:
|
||||
type_transport = items_list[0]
|
||||
|
||||
|
||||
for key, val in data.items():
|
||||
if val:
|
||||
if key == 'weight':
|
||||
@@ -162,9 +172,9 @@ def get_routes_Dict(user=None, data=None):
|
||||
else:
|
||||
kwargs.update({f'{key}__lte': int(weight_list[0])})
|
||||
|
||||
if key == 'type_transport':
|
||||
items_list = val.split(',')
|
||||
kwargs.update({f'{key}__in': items_list})
|
||||
# if key == 'type_transport':
|
||||
# items_list = val.split(',')
|
||||
# kwargs.update({f'{key}__in': items_list})
|
||||
|
||||
|
||||
if key in (
|
||||
@@ -184,19 +194,18 @@ def get_routes_Dict(user=None, data=None):
|
||||
kwargs.update({key: val})
|
||||
|
||||
if key == 'from_address_point':
|
||||
kwargs.update({f'from_city__id': val})
|
||||
city = get_city_by_type_transport_and_address_point(type_transport, val)
|
||||
kwargs.update({f'from_city': city})
|
||||
|
||||
res_Dict.update({
|
||||
'from_address_point_txt': get_country_n_city_str_by_type_transport_and_address_point(
|
||||
'road', val
|
||||
)
|
||||
'from_address_point_txt': city.get_country_n_city_str()
|
||||
})
|
||||
|
||||
if key == 'to_address_point':
|
||||
kwargs.update({f'to_city__id': val})
|
||||
city = get_city_by_type_transport_and_address_point(type_transport, val)
|
||||
kwargs.update({f'to_city': city})
|
||||
res_Dict.update({
|
||||
'to_address_point_txt': get_country_n_city_str_by_type_transport_and_address_point(
|
||||
'road', val
|
||||
)
|
||||
'to_address_point_txt': city.get_country_n_city_str()
|
||||
})
|
||||
|
||||
if key == 'from_el':
|
||||
|
||||
Reference in New Issue
Block a user