From fc8116cc4f5f27911c7685649ebac0a96fb39a49 Mon Sep 17 00:00:00 2001 From: Jannis Leidel Date: Sun, 22 May 2011 15:05:29 +0000 Subject: Fixed #6580 -- Added `default` parameter to `MultiValueDict.getlist` method (the base class for `QueryDict`). Many thanks to mk and andrewebdev. git-svn-id: http://code.djangoproject.com/svn/django/trunk@16260 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- docs/ref/request-response.txt | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'docs') diff --git a/docs/ref/request-response.txt b/docs/ref/request-response.txt index d4ff40a746..72872d5b40 100644 --- a/docs/ref/request-response.txt +++ b/docs/ref/request-response.txt @@ -448,11 +448,15 @@ In addition, ``QueryDict`` has the following methods: standard library. The copy will be mutable -- that is, you can change its values. -.. method:: QueryDict.getlist(key) +.. method:: QueryDict.getlist(key, default) Returns the data with the requested key, as a Python list. Returns an - empty list if the key doesn't exist. It's guaranteed to return a list of - some sort. + empty list if the key doesn't exist and no default value was provided. + It's guaranteed to return a list of some sort unless the default value + was no list. + + .. versionchanged:: 1.4 + The ``default`` parameter was added. .. method:: QueryDict.setlist(key, list_) -- cgit v1.3