Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Made `MultiValueDict`'s `get` and `getlist` method docstrings more de…

…scriptive.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@6714 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit c7181ec0ff14fb1515f009114b6d99f8374a819e 1 parent 891cc5d
@gdub gdub authored
Showing with 8 additions and 2 deletions.
  1. +8 −2 django/utils/datastructures.py
View
10 django/utils/datastructures.py
@@ -211,7 +211,10 @@ def __deepcopy__(self, memo=None):
return result
def get(self, key, default=None):
- """Returns the default value if the requested data doesn't exist."""
+ """
+ Returns the last data value for the passed key. If key doesn't exist
+ or value is an empty list, then default is returned.
+ """
try:
val = self[key]
except KeyError:
@@ -221,7 +224,10 @@ def get(self, key, default=None):
return val
def getlist(self, key):
- """Returns an empty list if the requested data doesn't exist."""
+ """
+ Returns the list of values for the passed key. If key doesn't exist,
+ then an empty list is returned.
+ """
try:
return super(MultiValueDict, self).__getitem__(key)
except KeyError:
Please sign in to comment.
Something went wrong with that request. Please try again.