summaryrefslogtreecommitdiff
path: root/docs/ref/request-response.txt
diff options
context:
space:
mode:
Diffstat (limited to 'docs/ref/request-response.txt')
-rw-r--r--docs/ref/request-response.txt33
1 files changed, 25 insertions, 8 deletions
diff --git a/docs/ref/request-response.txt b/docs/ref/request-response.txt
index cd0edc063c..6b29b3bb61 100644
--- a/docs/ref/request-response.txt
+++ b/docs/ref/request-response.txt
@@ -14,11 +14,11 @@ Django uses request and response objects to pass state through the system.
When a page is requested, Django creates an :class:`HttpRequest` object that
contains metadata about the request. Then Django loads the appropriate view,
-passing the :class:`HttpRequest` as the first argument to the view function. Each
-view is responsible for returning an :class:`HttpResponse` object.
+passing the :class:`HttpRequest` as the first argument to the view function.
+Each view is responsible for returning an :class:`HttpResponse` object.
-This document explains the APIs for :class:`HttpRequest` and :class:`HttpResponse`
-objects.
+This document explains the APIs for :class:`HttpRequest` and
+:class:`HttpResponse` objects.
HttpRequest objects
===================
@@ -103,7 +103,8 @@ All attributes except ``session`` should be considered read-only.
* ``read(num_bytes=None)`` -- Read a number of bytes from the file.
* ``name`` -- The name of the uploaded file.
* ``size`` -- The size, in bytes, of the uploaded file.
- * ``chunks(chunk_size=None)`` -- A generator that yields sequential chunks of data.
+ * ``chunks(chunk_size=None)`` -- A generator that yields sequential
+ chunks of data.
See :ref:`topics-files` for more information.
@@ -229,9 +230,10 @@ Methods
.. versionadded:: 1.0
- Returns ``True`` if the request was made via an ``XMLHttpRequest``, by checking
- the ``HTTP_X_REQUESTED_WITH`` header for the string ``'XMLHttpRequest'``. The
- following major JavaScript libraries all send this header:
+ Returns ``True`` if the request was made via an ``XMLHttpRequest``, by
+ checking the ``HTTP_X_REQUESTED_WITH`` header for the string
+ ``'XMLHttpRequest'``. The following major JavaScript libraries all send this
+ header:
* jQuery
* Dojo
@@ -317,6 +319,17 @@ a subclass of dictionary. Exceptions are outlined here:
>>> q = QueryDict('a=1&a=2&a=3')
>>> q.items()
[('a', '3')]
+
+.. method:: QueryDict.iteritems()
+
+ Just like the standard dictionary ``iteritems()`` method. Like
+ :meth:`QueryDict.items()` this uses the same last-value logic as
+ :meth:`QueryDict.__getitem()__`.
+
+.. method:: QueryDict.iterlists()
+
+ Like :meth:`QueryDict.iteritems()` except it includes all values, as a list,
+ for each member of the dictionary.
.. method:: QueryDict.values()
@@ -327,6 +340,10 @@ a subclass of dictionary. Exceptions are outlined here:
>>> q.values()
['3']
+.. method:: QueryDict.itervalues()
+
+ Just like :meth:`QueryDict.values()`, except an iterator.
+
In addition, ``QueryDict`` has the following methods:
.. method:: QueryDict.copy()