From 20a1c07ea1f1718ceb35b526f41c5c37b32082f8 Mon Sep 17 00:00:00 2001 From: Duncan Parkes Date: Wed, 11 Jun 2014 21:41:25 +0100 Subject: [PATCH] [1.6.x] Improved documentation for QueryDict. Backport of 7f4e2ef1e9 from master --- django/http/request.py | 13 ++++++++--- docs/ref/request-response.txt | 43 +++++++++++++++++++++++------------ 2 files changed, 38 insertions(+), 18 deletions(-) diff --git a/django/http/request.py b/django/http/request.py index dee6910382..deb0724fc7 100644 --- a/django/http/request.py +++ b/django/http/request.py @@ -265,12 +265,19 @@ class HttpRequest(object): class QueryDict(MultiValueDict): """ - A specialized MultiValueDict that takes a query string when initialized. - This is immutable unless you create a copy of it. + A specialized MultiValueDict which represents a query string. - Values retrieved from this class are converted from the given encoding + A QueryDict can be used to represent GET or POST data. It subclasses + MultiValueDict since keys in such data can be repeated, for instance + in the data from a form with a ``, pass multiple values for the same key. +In an :class:`HttpRequest` object, the ``GET`` and ``POST`` attributes are +instances of ``django.http.QueryDict``, a dictionary-like class customized to +deal with multiple values for the same key. This is necessary because some HTML +form elements, notably ``