##// END OF EJS Templates
Added method to check if the paginator supports new-style page links
neko259 -
r1379:a7080552 default
parent child Browse files
Show More
@@ -70,3 +70,5 class DividedPaginator(Paginator):
70 for key in self.params.keys()])
70 for key in self.params.keys()])
71 return self.link + url_params
71 return self.link + url_params
72
72
73 def supports_urls(self):
74 return self.link is not None and self.params is not None
@@ -45,4 +45,5 def post_view(post, *args, **kwargs):
45
45
46 @register.simple_tag(name='page_url')
46 @register.simple_tag(name='page_url')
47 def page_url(paginator, page_number, *args, **kwargs):
47 def page_url(paginator, page_number, *args, **kwargs):
48 return paginator.get_page_url(page_number)
48 if paginator.supports_urls():
49 return paginator.get_page_url(page_number)
General Comments 0
You need to be logged in to leave comments. Login now