Opened 16 years ago

Closed 16 years ago

Last modified 13 years ago

#8092 closed (fixed)

removing has_key, __getitem__ and contains from HttpRequest

Reported by: Uz Owned by: nobody
Component: HTTP handling Version: dev
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

Description

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 16 years ago.
removes getitem contains and has_key from HttpRequest

Download all attachments as: .zip

Change History (5)

by Uz, 16 years ago

Attachment: request.__getitem__.patch added

removes getitem contains and has_key from HttpRequest

comment:1 by Gary Wilson, 16 years ago

milestone: 1.01.0 beta

changes API, moving to beta.

comment:2 by Gary Wilson, 16 years ago

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 by Tobias McNulty, 16 years ago

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

comment:4 by Jacob, 13 years ago

milestone: 1.0 beta

Milestone 1.0 beta deleted

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