heroku
This commit is contained in:
parent
28756b9632
commit
e8be2da9e2
@ -5,11 +5,11 @@ register = template.Library()
|
||||
|
||||
def truncate(paginator, number):
|
||||
if number < 5:
|
||||
truncated_paginator = xrange(1, min(paginator+1, number+3))
|
||||
truncated_paginator = range(1, min(paginator+1, number+3))
|
||||
elif number > 4 and number < (paginator-3):
|
||||
truncated_paginator = xrange(number-3, number+3)
|
||||
truncated_paginator = range(number-3, number+3)
|
||||
else:
|
||||
truncated_paginator = xrange(number-3, paginator+1)
|
||||
truncated_paginator = range(number-3, paginator+1)
|
||||
return truncated_paginator
|
||||
|
||||
register.filter('truncate', truncate)
|
||||
|
Loading…
Reference in New Issue
Block a user