﻿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 multiple arguments and arguments of type Mapping[str, Any]	Sarah Boyce	Giannis Terzopoulos	"Based off this discussion: https://forum.djangoproject.com/t/adding-a-template-tag-to-generate-query-strings/24521/28

Currently `query_string` only supports a single `QueryDict` as an argument, consensus appears to want the following updates:

- support arguments of type `Mapping[str, Any]`
- support multiple arguments

Tests which hopefully illustrate the requested updates

{{{#!diff
--- a/tests/template_tests/syntax_tests/test_query_string.py
+++ b/tests/template_tests/syntax_tests/test_query_string.py
@@ -93,6 +93,18 @@ 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_multiple_args"": ""{% query_string my_dict my_query_dict %}""})
+    def test_query_string_with_multiple_args(self):
+        context = {""my_dict"": {""a"": 1, ""b"": 2}, ""my_query_dict"": QueryDict(""c=1"")}
+        output = self.engine.render_to_string(""query_string_multiple_args"", context)
+        self.assertEqual(output, ""?a=1&amp;b=2&amp;c=1"")
+
     @setup({""query_string_no_request_no_query_dict"": ""{% query_string %}""})
     def test_query_string_without_request_or_explicit_query_dict(self):
}}}"	New feature	closed	Template system	dev	Normal	fixed		Antoliny	Ready for checkin	1	0	0	0	0	0
