0.5.3
find route limit slice
This commit is contained in:
@@ -15,6 +15,9 @@ def get_routes_Dict(user=None, data=None):
|
||||
'owner': user
|
||||
})
|
||||
|
||||
from_el = None
|
||||
to_el = None
|
||||
|
||||
if data:
|
||||
for key, val in data.items():
|
||||
if val:
|
||||
@@ -25,11 +28,23 @@ def get_routes_Dict(user=None, data=None):
|
||||
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',
|
||||
'from_address_point_txt', 'to_address_point_txt', 'csrfmiddlewaretoken', 'sort', 'weight',
|
||||
'from_el', 'to_el'
|
||||
):
|
||||
kwargs.update({key: val})
|
||||
|
||||
if key == 'from_el':
|
||||
from_el = int(val)
|
||||
if key == 'to_el':
|
||||
to_el = int(val)
|
||||
|
||||
routes = Route.objects.filter(**kwargs).order_by('-modifiedDT')
|
||||
if from_el and to_el:
|
||||
routes = routes[from_el:to_el]
|
||||
elif from_el:
|
||||
routes = routes[from_el:]
|
||||
elif to_el:
|
||||
routes = routes[:to_el]
|
||||
|
||||
res_Dict = {}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user