Opened 12 years ago

Closed 11 years ago

Last modified 10 years ago

#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 Alex Gaynor, 12 years ago

Triage Stage: UnreviewedAccepted

comment:2 by Aymeric Augustin, 12 years ago

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.

comment:3 by Marc Tamlyn, 12 years ago

Cc: marc.tamlyn@… added

comment:4 by Eduardo Cereto, 12 years ago

Cc: eduardocereto@… added

comment:5 by Aymeric Augustin, 12 years ago

Component: Core (Other)HTTP handling

comment:6 by Baptiste Mispelon, 12 years ago

Cc: bmispelon@… added

comment:7 by Bouke Haarsma, 11 years ago

Owner: changed from nobody to Bouke Haarsma
Status: newassigned

I've proposed a deprecation in-between PR: https://github.com/django/django/pull/1756

comment:8 by Tim Graham, 11 years ago

Has patch: set
Patch needs improvement: set
Version: 1.4master

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 Tim Graham <timograham@…>, 11 years ago

Resolution: fixed
Status: assignedclosed

In 2fb5a51fa3ac276efc7121ec9de91f092a986104:

Fixed #18659 -- Deprecated request.REQUEST and MergeDict

Thanks Aymeric Augustin for the suggestion.

comment:10 by Tim Graham <timograham@…>, 10 years ago

In 75f107b8842dfc890ddd65262bd09ca87c3a15be:

Removed request.REQUEST per deprecation timeline; refs #18659.

comment:11 by Tim Graham <timograham@…>, 10 years ago

In 37b7776a015102e97b9bdd64d88c732883ff9989:

Removed django.utils.datastructures.MergeDict per deprecation timeline; refs #18659.

Note: See TracTickets for help on using tickets.
Back to Top