I want to change request.GET
querydict object in django. I tried this but changes made by me are not reflected. I tried this
tempdict = self.request.GET.copy() # Empty initially
tempdict['state'] = ['XYZ',]
tempdict['ajaxtype'] = ['facet',]
print self.request.GET
I get
<QueryDict: {}> as my output
Is it possible to change the request.GET
querydict object in django?
You can't change the request.GET
or request.POST
as they are instances of QueryDict
which are immutable according to the docs:
QueryDict instances are immutable, unless you create a copy() of them. That means you can’t change attributes of request.POST and request.GET directly.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With