Opened 11 years ago

Closed 11 years ago

Last modified 7 years ago

#8092 closed (fixed)

removing has_key, __getitem__ and contains from HttpRequest

Reported by: Uz Owned by: nobody
Component: HTTP handling Version: master
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


As django's template language first does a dictionary lookup, these methods lead to trouble with in connection with the request context_processor, as suggested in ticket #3828. To my knowledge it is advised to use request.REQUEST instead, anyways. So here's a patch to remove it.

Attachments (1)

request.__getitem__.patch (1.6 KB) - added by Uz 11 years ago.
removes getitem contains and has_key from HttpRequest

Download all attachments as: .zip

Change History (5)

Changed 11 years ago by Uz

Attachment: request.__getitem__.patch added

removes getitem contains and has_key from HttpRequest

comment:1 Changed 11 years ago by Gary Wilson

milestone: 1.01.0 beta

changes API, moving to beta.

comment:2 Changed 11 years ago by Gary Wilson

Resolution: fixed
Status: newclosed

(In [8202]) Fixed #8092, #3828 -- Removed dictionary access for request objects so that GET and POST data doesn't "overwrite" request attributes when used in templates (since dictionary lookup is performed before attribute lookup). This is backwards-incompatible if you were using the request object for dictionary access to the combined GET and POST data, but you should use request.REQUEST for that instead.

comment:3 Changed 11 years ago by Tobias McNulty

a deprecation notice would be REAL helpful on this change...

comment:4 Changed 7 years ago by Jacob

milestone: 1.0 beta

Milestone 1.0 beta deleted

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