﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
35529	Have the template tag query_string support Mapping[str, Any] as an argument	Sarah Boyce	nobody	"Based off this discussion: https://forum.djangoproject.com/t/adding-a-template-tag-to-generate-query-strings/24521/28

Currenty `query_string` only supports a `QueryDict` as an argument, consensus appears to want to update this to also support `Mapping[str, Any]`

{{{#!diff
--- a/tests/template_tests/syntax_tests/test_query_string.py
+++ b/tests/template_tests/syntax_tests/test_query_string.py
@@ -93,6 +93,14 @@ class QueryStringTagTests(SimpleTestCase):
         )
         self.assertEqual(output, ""?a=2&amp;b=2"")

+    @setup(
+        {""query_string_dict"": ""{% query_string my_dict %}""}
+    )
+    def test_query_string_with_explicit_dict_and_no_request(self):
+        context = {""my_dict"": {""a"": 1, ""b"": 2}}
+        output = self.engine.render_to_string(""query_string_dict"", context)
+        self.assertEqual(output, ""?a=1&amp;b=2"")
+
     @setup({""query_string_no_request_no_query_dict"": ""{% query_string %}""})
     def test_query_string_without_request_or_explicit_query_dict(self):
         msg = ""'Context' object has no attribute 'request'""
}}}


Note: I believe this is backwards compatible so not a release blocker "	New feature	new	Template system	5.1	Normal				Unreviewed	0	0	0	0	0	0
