Issues list pagination

This commit is contained in:
Klaas van Schelven
2025-02-18 09:47:30 +01:00
parent 7b32e71e1c
commit 2cb87f8334
4 changed files with 64 additions and 6 deletions

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,17 @@
from copy import copy
from django import template
from django.utils.http import urlencode
register = template.Library()
@register.simple_tag(takes_context=True)
def add_to_qs(context, **kwargs):
if 'request' not in context:
# "should not happen", because this tag is only assumed to be used in RequestContext templates, but it's not
# something I want to break for. Also: we have an answer that "mostly works" for that case, so let's do that.
return urlencode(kwargs)
query = copy(context['request'].GET.dict())
query.update(kwargs)
return urlencode(query)