However I get an error when I try to access this attribute, and in
addition it does not appear in the class documentation at
https://code.djangoproject.com/wiki/HttpRequest which leads me to believe
that this attribute no longer exists. It should be removed from the the
request-response documentation page.
--
Ticket URL: <https://code.djangoproject.com/ticket/20570>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* status: new => closed
* needs_better_patch: => 0
* resolution: => invalid
* needs_tests: => 0
* needs_docs: => 0
Comment:
It does still exist. Your link is to the wiki, not the official
documentation: https://docs.djangoproject.com/en/dev/ref/request-
response/#django.http.HttpRequest.REQUEST
That being said, there is a ticket to deprecate it, #18659.
--
Ticket URL: <https://code.djangoproject.com/ticket/20570#comment:1>
Comment (by anonymous):
Ah, sorry! I think my problem was that I was using RequestFactory
https://docs.djangoproject.com/en/1.5/topics/testing/advanced/ to generate
the request. My best guess is that the RequestFactory class does not
produce an HttpRequest with a REQUEST attribute.
--
Ticket URL: <https://code.djangoproject.com/ticket/20570#comment:2>
Comment (by bmispelon):
Hi,
It seems to be working fine for me:
{{{
>>> from django.test.client import RequestFactory
>>> request = RequestFactory().get('/foo/?bar=baz')
>>> request.GET
<QueryDict: {'bar': ['baz']}>
>>> request.REQUEST
MergeDict(<QueryDict: {}>, <QueryDict: {'bar': ['baz']}>)
}}}
Can you provide some steps to reproduce your issue?
Thanks.
--
Ticket URL: <https://code.djangoproject.com/ticket/20570#comment:3>
Comment (by anonymous):
Sorry, turns out was not RequestFactory either. I was hand-generating a
request like this:
{{{
r = HttpRequest()
r.method = 'GET'
r.GET = QueryDict('foo')
}}}
RequestFactory( ) still works fine, this was just an oversight on my part.
Sorry to waste everyone's time!
--
Ticket URL: <https://code.djangoproject.com/ticket/20570#comment:4>
* needs_better_patch: 0 => 1
* component: Documentation => contrib.admin
* needs_tests: 0 => 1
* version: 1.5 => master
* keywords: => 1
* needs_docs: 0 => 1
* has_patch: 0 => 1
* ui_ux: 0 => 1
* type: Cleanup/optimization => Uncategorized
Comment:
1
--
Ticket URL: <https://code.djangoproject.com/ticket/20570#comment:5>
* keywords: => 1
* component: Documentation => contrib.admin
* version: 1.5 => master
* resolution: invalid => fixed
* type: Cleanup/optimization => Uncategorized
Comment:
1
--
Ticket URL: <https://code.djangoproject.com/ticket/20570#comment:6>
* status: closed => new
* type: Cleanup/optimization => Uncategorized
* component: Documentation => contrib.admin
* version: 1.5 => master
* keywords: => 1
* resolution: invalid =>
Comment:
1
--
Ticket URL: <https://code.djangoproject.com/ticket/20570#comment:7>