0.6.1
routes filter pagination
This commit is contained in:
@@ -39,6 +39,8 @@ def get_routes_Dict(user=None, data=None):
|
|||||||
to_el = int(val)
|
to_el = int(val)
|
||||||
|
|
||||||
routes = Route.objects.filter(**kwargs).order_by('-modifiedDT')
|
routes = Route.objects.filter(**kwargs).order_by('-modifiedDT')
|
||||||
|
routes_count = routes.count()
|
||||||
|
|
||||||
if from_el and to_el:
|
if from_el and to_el:
|
||||||
routes = routes[from_el:to_el]
|
routes = routes[from_el:to_el]
|
||||||
elif from_el:
|
elif from_el:
|
||||||
@@ -48,6 +50,10 @@ def get_routes_Dict(user=None, data=None):
|
|||||||
else:
|
else:
|
||||||
routes = routes[:25]
|
routes = routes[:25]
|
||||||
|
|
||||||
|
last_block_routes = False
|
||||||
|
if to_el and to_el >= routes_count:
|
||||||
|
last_block_routes = True
|
||||||
|
|
||||||
res_Dict = {}
|
res_Dict = {}
|
||||||
|
|
||||||
try:
|
try:
|
||||||
@@ -72,7 +78,8 @@ def get_routes_Dict(user=None, data=None):
|
|||||||
print(msg)
|
print(msg)
|
||||||
|
|
||||||
res_Dict = {
|
res_Dict = {
|
||||||
'routes': routes
|
'routes': routes,
|
||||||
|
'last_block_routes': last_block_routes
|
||||||
}
|
}
|
||||||
return res_Dict
|
return res_Dict
|
||||||
|
|
||||||
|
|||||||
@@ -169,6 +169,7 @@ def find_routes_ajax(request):
|
|||||||
|
|
||||||
res_Dict = {
|
res_Dict = {
|
||||||
'html': html,
|
'html': html,
|
||||||
|
'last_block_routes': routes_Dict['last_block_routes']
|
||||||
# 'form': RouteForm(initial=data)
|
# 'form': RouteForm(initial=data)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user