#18659 closed Cleanup/optimization (fixed)
Remove `request.REQUEST`
Reported by: | Aymeric Augustin | Owned by: | Bouke Haarsma |
---|---|---|---|
Component: | HTTP handling | Version: | master |
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 Changed 9 years ago by
Triage Stage: | Unreviewed → Accepted |
---|
comment:2 Changed 9 years ago by
comment:3 Changed 9 years ago by
Cc: | marc.tamlyn@… added |
---|
comment:4 Changed 9 years ago by
Cc: | eduardocereto@… added |
---|
comment:5 Changed 8 years ago by
Component: | Core (Other) → HTTP handling |
---|
comment:6 Changed 8 years ago by
Cc: | bmispelon@… added |
---|
comment:7 Changed 7 years ago by
Owner: | changed from nobody to Bouke Haarsma |
---|---|
Status: | new → assigned |
I've proposed a deprecation in-between PR: https://github.com/django/django/pull/1756
comment:8 Changed 7 years ago by
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 Changed 7 years ago by
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.