#18659 closed Cleanup/optimization (fixed)
Remove `request.REQUEST`
Reported by: | Aymeric Augustin | Owned by: | Bouke Haarsma |
---|---|---|---|
Component: | HTTP handling | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | marc.tamlyn@…, eduardocereto@…, bmispelon@… | Triage Stage: | Accepted |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | yes |
Easy pickings: | no | UI/UX: | no |
Description
request.REQUEST
provides indifferent access to request.GET
or request.POST
(PHP style).
This attribute is a legacy from the pre-1.0 days, when you could access the GET
or POST
data using dict syntax on the request object. request.REQUEST
was introduced in 1.0 to make this operation more explicit, with an easy upgrade path.
It's hardly ever a good design pattern to handle GET
and POST
identically, and it's our responsibility not to provide tools who are more likely to result in bad code than anything else. So I think it's time to deprecate this attribute.
We could deprecate django.utils.datastructures.MergeDict
at the same time — it's a 100-lines long class whose sole purpose is to support request.REQUEST
.
Change History (11)
comment:1 by , 12 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:2 by , 12 years ago
comment:3 by , 12 years ago
Cc: | added |
---|
comment:4 by , 12 years ago
Cc: | added |
---|
comment:5 by , 12 years ago
Component: | Core (Other) → HTTP handling |
---|
comment:6 by , 12 years ago
Cc: | added |
---|
comment:7 by , 11 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
I've proposed a deprecation in-between PR: https://github.com/django/django/pull/1756
comment:8 by , 11 years ago
Has patch: | set |
---|---|
Patch needs improvement: | set |
Version: | 1.4 → master |
Mailing list thread to make sure there is consensus to move forward with this:
https://groups.google.com/d/topic/django-developers/yw7OPb_O0QA/discussion
The patch would also need to be updated to reflect the fact that the deprecation would start in 1.7 (1.6 is feature frozen at this time).
comment:9 by , 11 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
This may break a lot of code, so this isn't a decision to make lightly.
Django itself uses
request.REQUEST
in i18n views, auth, and admin.