- def __init__(self, template=None, window=None, margin=None):
+ def __init__(self, template=None, window=None, margin=None, ignored_vars=None):
def render(self, context):
template_list = ['pagination/pagination.html']
def render(self, context):
template_list = ['pagination/pagination.html']
- new_context = paginate(context, window=self.window, margin=self.margin)
+ new_context = paginate(context, window=self.window, margin=self.margin, ignored_vars=self.ignored_vars)
if self.template:
template_list.insert(0, self.template)
return loader.render_to_string(template_list, new_context)
if self.template:
template_list.insert(0, self.template)
return loader.render_to_string(template_list, new_context)
else:
raise TemplateSyntaxError(
"Invalid syntax. Proper usage of this tag is: "
"{% paginate [using \"TEMPLATE\"] %}")
else:
raise TemplateSyntaxError(
"Invalid syntax. Proper usage of this tag is: "
"{% paginate [using \"TEMPLATE\"] %}")
- return PaginateNode(template, window, margin)
+ return PaginateNode(template, window, margin, ignored_vars)
-def paginate(context, window=DEFAULT_WINDOW, margin=DEFAULT_MARGIN):
+def paginate(context, window=DEFAULT_WINDOW, margin=DEFAULT_MARGIN, ignored_vars=None):
"""
Renders the ``pagination/pagination.html`` template, resulting in a
Digg-like display of the available pages, given the current page. If there
"""
Renders the ``pagination/pagination.html`` template, resulting in a
Digg-like display of the available pages, given the current page. If there
page_suffix = context.get('page_suffix', '')
page_range = list(paginator.page_range)
# Calculate the record range in the current page for display.
page_suffix = context.get('page_suffix', '')
page_range = list(paginator.page_range)
# Calculate the record range in the current page for display.
if 'page%s' % page_suffix in getvars:
del getvars['page%s' % page_suffix]
if len(getvars.keys()) > 0:
if 'page%s' % page_suffix in getvars:
del getvars['page%s' % page_suffix]
if len(getvars.keys()) > 0: