Opened 7 years ago

Closed 7 years ago

Last modified 4 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: UI/UX:

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

Download all attachments as: .zip

Change History (5)

Changed 7 years ago by Uz

removes getitem contains and has_key from HttpRequest

comment:1 Changed 7 years ago by gwilson

  • milestone changed from 1.0 to 1.0 beta
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

changes API, moving to beta.

comment:2 Changed 7 years ago by gwilson

  • Resolution set to fixed
  • Status changed from new to closed

(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 7 years ago by tobias

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

comment:4 Changed 4 years ago by jacob

  • milestone 1.0 beta deleted

Milestone 1.0 beta deleted

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