I am trying to translate the code that I use in my templates and js into content_type and object_id, which are used by the wrapped function:
def translate_modelcode(function=None,redirect_field_name=None): """ translate an item-code specified in settings to a content_type and the item-id to the object_id """ def _decorator(function): def _wrapped_view(request, *args, **kwargs): item_code=request.REQUEST.get('item-code',None) if item_code: object_id = request.REQUEST.get('item-id',None)
The point I'm stuck at is updating the .POST / request.GET QueryDict request. Django reports that these dictations are unchanging. How can I update them?
From djangodocs, I thought that .update would use the "last value" logic described there, which I would do just fine. But this does not happen. Making a copy and reassigning this .GET request does not work either:
request.GET = request.GET.copy().update(ud_dict)
There is a somewhat similar question on this topic here, but it has not received a satisfactory answer. Using the same code as in this question, I just get zero return for the request. POST or request.GET after update:
request._get = request.GET.copy() import ipdb;ipdb.set_trace() ipdb> request.GET ipdb>
So what can I do with this?
marue
source share