From e8e16abe6a797789427a79cd66175ae70f392a08 Mon Sep 17 00:00:00 2001 From: Duncan Parkes Date: Wed, 11 Jun 2014 21:41:25 +0100 Subject: [PATCH] [1.7.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 ecad639c82..1306dd3227 100644 --- a/django/http/request.py +++ b/django/http/request.py @@ -288,12 +288,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 ``