summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorSarah Boyce <42296566+sarahboyce@users.noreply.github.com>2024-07-15 18:28:55 +0200
committerGitHub <noreply@github.com>2024-07-15 13:28:55 -0300
commit27043bde5b795eb4a605aeca1d3bc4345d2ca478 (patch)
treeb00dd8c3e01ae68ad5293738c709b1a34b33eaf8 /django
parent65344f0e1ecfff3e9623c18c51eff8fe72f9a9df (diff)
Refs #10941 -- Renamed query_string template tag to querystring.
Diffstat (limited to 'django')
-rw-r--r--django/template/defaulttags.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/django/template/defaulttags.py b/django/template/defaulttags.py
index dd0a6b3579..ae74679ec6 100644
--- a/django/template/defaulttags.py
+++ b/django/template/defaulttags.py
@@ -1169,8 +1169,8 @@ def now(parser, token):
return NowNode(format_string, asvar)
-@register.simple_tag(takes_context=True)
-def query_string(context, query_dict=None, **kwargs):
+@register.simple_tag(name="querystring", takes_context=True)
+def querystring(context, query_dict=None, **kwargs):
"""
Add, remove, and change parameters of a ``QueryDict`` and return the result
as a query string. If the ``query_dict`` argument is not provided, default
@@ -1178,19 +1178,19 @@ def query_string(context, query_dict=None, **kwargs):
For example::
- {% query_string foo=3 %}
+ {% querystring foo=3 %}
To remove a key::
- {% query_string foo=None %}
+ {% querystring foo=None %}
To use with pagination::
- {% query_string page=page_obj.next_page_number %}
+ {% querystring page=page_obj.next_page_number %}
A custom ``QueryDict`` can also be used::
- {% query_string my_query_dict foo=3 %}
+ {% querystring my_query_dict foo=3 %}
"""
if query_dict is None:
query_dict = context.request.GET