Django

Code

Show
Ignore:
Timestamp:
08/03/08 14:55:26 (4 months ago)
Author:
gwilson
Message:

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.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/docs/request_response.txt

    r7814 r8202  
    171171------- 
    172172 
    173 ``__getitem__(key)`` 
    174    Returns the GET/POST value for the given key, checking POST first, then 
    175    GET. Raises ``KeyError`` if the key doesn't exist. 
    176  
    177    This lets you use dictionary-accessing syntax on an ``HttpRequest`` 
    178    instance. Example: ``request["foo"]`` would return ``True`` if either 
    179    ``request.POST`` or ``request.GET`` had a ``"foo"`` key. 
    180  
    181 ``has_key()`` 
    182    Returns ``True`` or ``False``, designating whether ``request.GET`` or 
    183    ``request.POST`` has the given key. 
    184  
    185173``get_host()`` 
    186174   **New in Django development version**