kumify/common/templatetags/request.py

8 lines
226 B
Python

from django import template
register = template.Library()
@register.simple_tag(takes_context=True)
def querystring(context, **kwargs):
string = context["request"].GET.urlencode()
return f"?{string}" if string else ""