Django – Rebuild a query string without one of the variables
I have a Django view that processes a GET request. I want to rebuild the query string to include all variables except for one. I was initially using list comprehension: >>> from django.http import QueryDict >>> q = QueryDict(‘a=2&b=4&c=test’) // <— make believe this is request.GET >>> z = QueryDict(”).copy() >>> z.update(dict([x for x in … Read more