Looking at dir(request.GET), I notice that pop is listed as a method. I also believe i've popped off attributes from request in the past.
Is that accurate? If so, why would this fail?
request.GET.pop('key')
request.GET
and request.POST
are immutable QueryDict
instances. This means you cannot change their attributes directly.
Copying a QueryDict
, returns a mutable QueryDict
. You can then call the pop method of the copy without raising an error.
request.GET
GET = request.GET.copy()
GET.pop('key')
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