Re: What's the best way to create a reusable pagination template?

2017-02-28 Thread fabrixxm
Yep. My solution is a custom template tag from django.template.defaulttags import register from urllib.parse import urlencode @register.simple_tag(takes_context=True) def querystringmod(context, *args): """Modify current querystring: {% querystringmod name value [name value [...]] %}

What's the best way to create a reusable pagination template?

2017-02-27 Thread Frederik Creemers
The code for rendering pagination controls in my app is the same everywhere: {% if is_paginated %} {% if page_obj.has_previous %} Previous {% endif %} {% if page_obj.has_next %} Previous {% endif %}