summaryrefslogtreecommitdiff
path: root/docs/ref
diff options
context:
space:
mode:
authorJacob Kaplan-Moss <jacob@jacobian.org>2009-03-31 06:30:07 +0000
committerJacob Kaplan-Moss <jacob@jacobian.org>2009-03-31 06:30:07 +0000
commit184ea1c91f06d31d0e1d34b2c27c08b01d2d5033 (patch)
tree620b15d0030d4238002ea5937cd9a59d3521c21c /docs/ref
parent9ae873fcd83221a17d41f31f2ac32e37f439ae7b (diff)
Fixed #8847, #10370: added some missing methods to MultiValueDict after [8399]. Thanks, James Turk and rfk.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10241 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs/ref')
-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()