0.4.5
routes filter
This commit is contained in:
@@ -18,7 +18,15 @@ def get_routes_Dict(user=None, data=None):
|
||||
if data:
|
||||
for key, val in data.items():
|
||||
if val:
|
||||
if key not in ('from_address_point_txt', 'to_address_point_txt', 'csrfmiddlewaretoken', 'sort'):
|
||||
if key == 'weight':
|
||||
weight_list = val.split(';')
|
||||
if weight_list[0]:
|
||||
kwargs.update({f'{key}__gte': int(weight_list[0])})
|
||||
if weight_list[1]:
|
||||
kwargs.update({f'{key}__lte': int(weight_list[1])})
|
||||
if key not in (
|
||||
'from_address_point_txt', 'to_address_point_txt', 'csrfmiddlewaretoken', 'sort', 'weight',
|
||||
):
|
||||
kwargs.update({key: val})
|
||||
|
||||
routes = Route.objects.filter(**kwargs).order_by('-modifiedDT')
|
||||
|
||||
Reference in New Issue
Block a user