Django

Code

Ticket #8092 (closed: fixed)

Opened 4 months ago

Last modified 4 months ago

removing has_key, __getitem__ and contains from HttpRequest

Reported by: Uz Assigned to: nobody
Milestone: 1.0 beta Component: HTTP handling
Version: SVN Keywords:
Cc: Triage Stage: Unreviewed
Has patch: 1 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

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

request.__getitem__.patch (1.6 kB) - added by Uz on 08/02/08 15:31:08.
removes getitem contains and has_key from HttpRequest

Change History

08/02/08 15:31:08 changed by Uz

  • attachment request.__getitem__.patch added.

removes getitem contains and has_key from HttpRequest

08/03/08 14:05:46 changed by gwilson

  • needs_better_patch changed.
  • needs_docs changed.
  • needs_tests changed.
  • milestone changed from 1.0 to 1.0 beta.

changes API, moving to beta.

08/03/08 14:55:27 changed by gwilson

  • status changed from new to closed.
  • resolution set to fixed.

(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.

08/11/08 13:56:28 changed by tobias

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


Add/Change #8092 (removing has_key, __getitem__ and contains from HttpRequest)




Change Properties
Action